Positron IDE doing Data Analysis with R (Public Beta)

Поділитися
Вставка
  • Опубліковано 24 лип 2024
  • Timeline
    00:00 Intro
    00:25 Select R as the interpreter from the upper right corner.
    00:40 View the usual R startup message in the lower-left window.
    00:50 Discussion on keyboard shortcuts.
    02:00 Enable RStudio keyboard shortcut mapping in Positron.
    02:47 Create a new R Project in Positron for data analysis.
    04:10 Discuss setting the working directory correctly in the R Project.
    05:02 Save R Script using CMD + S or CTRL + S.
    05:45 Mouse over a file to see its file system path.
    06:02 Close the explorer bar for maximum screen space.
    06:45 Start coding in an R Script.
    07:47 Use CMD + ENTER or CTRL + ENTER to send code from the R script to the console.
    09:04 Mouse over URLs and hold CMD or CTRL to make them clickable.
    10:00 Discuss session and variables holding code results.
    10:42 Observe downloaded data in the R project directory using the file explorer.
    11:30 Explore what a Data Frame looks like under the session's Data subheader.
    12:00 Trigger the interactive data explorer.
    12:27 Identify variable types (pound sign (#) for numbers, (A) for strings/factors).
    13:50 Sort data within the interactive data viewer.
    15:00 Apply a filter to the data.
    16:00 Hide/clear filters.
    16:31 Expand the right-hand side to see additional text like variable type and number of observations.
    19:00 Modify the dataframe to include a new derived variable that is a factor.
    19:40 Open the Data Viewer using the View() function.
    20:55 Handle an error with a missing package.
    22:36 Graph with ggplot2.
    24:35 Explore the plot area of Positron.
    26:57 Demonstrate Plotly with ggplot2.
    28:31 Count with dplyr.
    29:03 Use the pipe operator shortcut (CMD + SHIFT + M or CTRL + SHIFT + M).
    30:21 Create a gt() table with the count data.
    31:07 Explore help documentation with Positron.
    31:38 Run examples to execute static examples within the help window.
    31:58 Handle a hiccup when viewing the package's index HTML page.
    32:06 Final thoughts.
    Summary ---
    For this video, we take a look at the Positron IDE's R session features. We focus on using an R project and a single R script file. We explore different portions of the interface, including the famed interactive data viewer.
    This video covers a large gambit from setting up keyboard shortcuts similar to what is available in RStudio to creating interactive plots using the {plotly} package.
    Links ---
    Positron Keyboard Shortcuts Wiki Page
    github.com/posit-dev/positron...
    Data location:
    github.com/coatless/raw-data/...
    Relevant script file:
    github.com/coatless-videos/po...
    Positron Interactive Data Viewer Wiki Page
    github.com/posit-dev/positron...
    Positron can be obtained from:
    github.com/posit-dev/positron
    Version information ----
    This was demonstrated on:
    Positron Version: 2024.06.1 (Universal) build 27
    Code - OSS Version: 1.90.0
    Commit: a893e5b282612ccb2200102957ac38d3c14e5196
    Date: 2024-06-26T02:08:06.673Z
    Electron: 29.4.0
    Chromium: 122.0.6261.156
    Node.js: 20.9.0
    V8: 12.2.281.27-electron.0
    OS: Darwin arm64 23.5.0
    #positron #posit #rstudio #ggplot2 #plotly #gt #csv
  • Наука та технологія

КОМЕНТАРІ • 32

  • @osoriomatucurane9511
    @osoriomatucurane9511 22 дні тому +2

    This is absolutely Superb. Thank you for working us through some of the great feature of this awesome IDE. I hope it works well with Quartto.

    • @thecoatlessprofessor7674
      @thecoatlessprofessor7674  22 дні тому

      It works great with Quarto! There’s a bit of setup required prior to creating a Quarto document. See: m.ua-cam.com/video/Xs6UnArkG4c/v-deo.html

    • @osoriomatucurane9511
      @osoriomatucurane9511 22 дні тому +1

      @@thecoatlessprofessor7674 Awesome, thank you Professor once again for sharing the resources and keeping us abreast with new developments making data analytics even more exciting.

  • @econmaett
    @econmaett 22 дні тому

    Thank you so much for creating this video!

  • @salvatoremangiafico5268
    @salvatoremangiafico5268 22 дні тому +1

    Thanks. This was helpful. One thing I was absolutely missing is that, on Windows, ctrl-enter runs the line and sends the output to the console. Still a lot I don't understand about the functionality, but at least at this point I can _use_ it.

    • @thecoatlessprofessor7674
      @thecoatlessprofessor7674  22 дні тому

      Could you clarify a bit on the functionality remark? Is there a particular use case you are after or are you trying to understand where the editor would fall in your workflow?

    • @salvatoremangiafico5268
      @salvatoremangiafico5268 21 день тому

      @@thecoatlessprofessor7674 Well, one thing I wonder about is running a chunk of code --- and getting the output in the console, or the plot displayed --- like you can do by highlighting a chunk and pressing the run button in RStudio. I guess for people who use this kind of IDE, that's not desirable ? Better to ctrl-enter ? ... And then basically everything with the debugger. I can't make heads or tails of how to use it.

    • @thecoatlessprofessor7674
      @thecoatlessprofessor7674  20 днів тому

      So, I think there's a lot of questions surrounding an analysis using Quarto instead of just an R script? Does that sound about right?
      In that case, I would say you still have the ability to run code cells by using Cmd/Ctrl+Enter for a single line, Cmd/Ctrl + Shift + Enter or the "Run Cell" button for the entire cell.
      If you want to create in the R script file a similar "cell" appearance, you need to use `#+` instead of the python version of `# %%`. It's really good to develop keyboard muscle memory instead of using a point-and-click mouse as that takes additional time to complete a task, e.g. pressing a run button.
      Regarding the debugger, have you check out this video?
      ua-cam.com/video/p_4ZS-nnQ2Q/v-deo.html

    • @salvatoremangiafico5268
      @salvatoremangiafico5268 20 днів тому

      @@thecoatlessprofessor7674 Thanks. For my comments, no, nothing about Quarto. Just running a script. I still can't figure out how to run a chunk of the script. But more fundamentally, why this isn't a simple press of a button. Like, obviously, that's not how people use this software. Or they set cells or breakpoints or something if they want to do that. I just haven't quite figured the mentality of using this software. (I'm not familiar with VSCode, just RStudio and Spyder). ... I do think a few issues come down to things being in beta. Your debugging video was helpful. But, for example, trying to use Run and Debug; it tells me I don't have an R debugger; and then when I try to install from the options, it tells me it's not compatible with Positron. I take it this is just a beta issue, or I just have no idea what I'm doing. ... It's no biggy. None of this I need to figure out right away. Just trying to see if this kind of software will improve what I do, or if I'm just a RStudio and Spyder person.

  • @Aaqib..
    @Aaqib.. 22 дні тому +1

    Yes i am loving it so far, seemless experience with R and Python, i never liked working with Python in R studio, that was a mess for me tbh, Positron is a breeze. Quarto works fine too. So far i haven't encountered any issues, except that i am not able to move the panes around.😅😂

    • @thecoatlessprofessor7674
      @thecoatlessprofessor7674  22 дні тому

      Mmm, what happens when you try to drag and drop different parts of the interface? Also, what happens when you click on the layout button in the upper right corner of Positron?

    • @Aaqib..
      @Aaqib.. 22 дні тому +1

      @@thecoatlessprofessor7674 i uninstalled and reinstalled on my newer machine, works fine, on the old one changing layout wasn't doing anything. Like i still would end up having the same layout. Now it is just the way i like it.🤝🏻

  • @WhySoBroke
    @WhySoBroke 16 днів тому

    Great video!! Is it possible to load GitHub Copilot in Positron?

    • @thecoatlessprofessor7674
      @thecoatlessprofessor7674  16 днів тому

      It’s not possible to use a GitHub copilot extension due to MS licensing issues in Positron. If you have a Copilot subscription, the only way forward is to use {chattr} R package. Otherwise, you will need to stay in VS code or switch to an LLM that has an extension on OpenVSX.

  • @oluwafemioyedele
    @oluwafemioyedele 12 днів тому +1

    Great; please can you share the link for me to download positron ?

    • @thecoatlessprofessor7674
      @thecoatlessprofessor7674  11 днів тому +1

      See video description for link to repository. I have two videos on the channel showing the download steps for macOS/Windows

    • @oluwafemioyedele
      @oluwafemioyedele 11 днів тому

      @@thecoatlessprofessor7674thanks, I have figured it out!

  • @diegoitibere
    @diegoitibere 19 днів тому

    I couldn't find the "zoom" option in the plots? Is is still there in Positron or is is just in Rstudio?

    • @thecoatlessprofessor7674
      @thecoatlessprofessor7674  19 днів тому +1

      There is no option yet in the Positron IDE for zooming on plots. You can only focus different windows.
      They are tracking it as a feature in:
      github.com/posit-dev/positron/issues/2270

  • @restrollar8548
    @restrollar8548 18 днів тому

    This should be good in the future, especially for R. But they need to enable remote ssh / dev containers! On their list, but not yet there.

    • @thecoatlessprofessor7674
      @thecoatlessprofessor7674  17 днів тому

      Yup, it's early days for the new IDE. If you already leaped to VS Code for more advanced features, this IDE is probably missing some features of your current workflow.

  • @richardbennett4365
    @richardbennett4365 18 днів тому

    Posit-Ron by Posit. 😮😅🎉😊

  • @coopernik
    @coopernik 22 дні тому +1

    Prove me wrong but this is just vscode 😅

    • @thecoatlessprofessor7674
      @thecoatlessprofessor7674  22 дні тому +1

      The Positron IDE is a _fork_ of the open source Visual Studio Code (OSS - Code). So, it should feel a lot like VS Code in certain areas.
      One huge benefit to this approach: Access to VS Code extensions published onto OpenVSX.

    • @88fjoe
      @88fjoe 22 дні тому +2

      With much better IDE experience for data workflows! VScode data analysis experience is a mess with chaotic interpreter manager, subpar dataframe viewer via 3rd party plug-ins and a missing variable viewer pane

    • @VelkoKamenov
      @VelkoKamenov 21 день тому

      Actually VS Code can be set in a very similar manner for Python with the Data Wrangler Extension for data frame viewing (it is official Microsoft Extension) and a variable pane is present when running code through an interactive jupyter window (it can be set in the settings when running a line of code to be automatically send to a jupyter window). However, in Positron it is great that all this functionality is available out of the box and also for R because in VS Code I never found a suitable R extension to work with.

    • @thecoatlessprofessor7674
      @thecoatlessprofessor7674  20 днів тому

      I agree it's really nice that a lot of the functionality is just _there_ without needing to setup the editor.
      Psst, the variable panel is still present in the panel bar when using a Jupyter notebook ;) Though, none of the variables will appear nor will the debugger/breakpoints work correctly in notebook view (so a slight downgrade from the current status quo in VS Code for Python).

    • @oluwafemioyedele
      @oluwafemioyedele 13 днів тому

      Great 🎉

  • @richardbennett4365
    @richardbennett4365 18 днів тому

    This thing is just a rehash of what we already have with Code, as this software is a fork of it, and marimo and jupyter.

    • @thecoatlessprofessor7674
      @thecoatlessprofessor7674  17 днів тому

      Not at all. The set up here is instantaneous and it's using a new high-performance R kernel and Language Server Protocol implementation called Ark that is licensed under the MIT License, c.f.
      github.com/posit-dev/ark