Exploratory Data Analysis with R in Positron

Exploratory Data Analysis with R in Positron

This blog post and the associated video is for R users (new and seasoned) who want a peek at Positron, the new IDE from Posit designed to support, especially, code-first data science projects and workflows. Positron is a polyglot IDE, but in this post and video we’ll focus on using Positron with R. It’s impossible to fit all the cool things about exploring data in Positron into a short video but the video will highlight features and workflows that will be familiar to seasoned RStudio users as well as novel ones that are sure to catch your attention.

Some of the highlights from the video include:

 

Organizing your work in a folder

 

Getting started is a breeze. Create a new workspace, add subfolders and files, and copy-and-paste your data, all from within Positron.

 

Exploring your data with the Data Explorer

 

One of Positron’s standout features is the Data Explorer. It gives you multiple ways to peek into your data even before loading into your workspace:

  • Click on a CSV file in the project pane to open it instantly in the Data Explorer, providing a spreadsheet-like view.
  • Alternatively, open the same file as plain text to see the raw contents. 

When working with your loaded data — whether they’re data.frame, tibble, or data.table objects — you can open them directly from the Variables pane by double-clicking on it or using the View() function for a quick look. The Data Explorer features:

  • Three distinct areas: The Data Explorer is split into the data grid, summary panel, and filter bar — all designed to give you comprehensive control over your data inspection.
  • Summary panel options: Customize your view by toggling the summary panel on the right or tucking it away for a cleaner interface. You can do this interactively or via user settings dataExplorer.summaryCollapsed and dataExplorer.summaryLayout.
  • Sorting and filtering: Sort your columns easily and clear sorts when needed. Apply filters with single or multiple conditions and check the count of rows matching those filters at the bottom of the data grid.
  • Selecting and copying: Highlight rows and columns you want in the data grid and paste them directly into Excel or Google Sheets — perfect for quick sharing!

For more details, check out the official Data Explorer documentation.

     

    Code auto-formatting

     

    Format your code with Air on demand or every time you save your script, maintaining a consistent and tidy code style throughout your script and entire workspace.

     

    Plotting

     

    Use familiar tools to create your plots, and then

    • Pop your plot out to a dedicated editor window when you want to inspect it in detail.
    • Resize plots easily — for example, change the aspect ratio to square or other preset options.
    • Scroll through your plot history, keeping what you’d like to come back to, discarding what you don’t.
    • Copy your plots for sharing, e.g., directly from Positron to an email.

    Positron is a fantastic environment tailored for doing data science with R. Its streamlined folder organization, handy data explorer, developer-friendly features like code formatting, flexible plotting, instant access to function documentation, etc. make your workflow smoother and more enjoyable.

    If you haven’t tried it yet, now’s a great time to spin up Positron and experience a next-gen R IDE. Get started at https://positron.posit.co/start.html.