Positron IDE doing Data Analysis with R (Public Beta)

Published 2024-07-01
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/wiki/Keyboard-Shortcโ€ฆ

Data location:

github.com/coatless/raw-data/raw/main/penguins.csv

Relevant script file:

github.com/coatless-videos/positron-public-beta/blโ€ฆ

Positron Interactive Data Viewer Wiki Page

github.com/posit-dev/positron/wiki/Data-Explorer

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

All Comments (11)
  • 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.
  • @Aaqib..
    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.๐Ÿ˜…๐Ÿ˜‚
  • @econmaett
    Thank you so much for creating this video!
  • 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.
  • 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.
  • @diegoitibere
    I couldn't find the "zoom" option in the plots? Is is still there in Positron or is is just in Rstudio?
  • @WhySoBroke
    Great video!! Is it possible to load GitHub Copilot in Positron?
  • 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.
  • @coopernik
    Prove me wrong but this is just vscode ๐Ÿ˜