Overview

Master R development in Positron with native language support. Discover settings, keyboard shortcuts, debugging tools, and interactive Console features.

Positron ships with first class support for R, along with Python. Start with our guide on how Positron discovers and manages R installations, then read on for details on working with R code in Positron.

Settings

Tip

If you’d prefer to customize Positron to feel similar to RStudio, learn what settings to consider.

Positron provides setting defaults for working with R, but you can override or change these defaults if you prefer a different experience. For example, Positron sets the tab size for R code to 2 spaces, but if you prefer 4 spaces, you can change the editor.tabSize setting for R files by adding the following to your user or workspace settings.json:

{
    "[r]":  {
      "editor.tabSize": 4
    }
}

You can see all the setting defaults that Positron provides with the command Preferences: Open Default Settings (JSON).

Keyboard shortcuts

The keyboard shortcuts in Positron are largely a superset of the keyboard shortcuts used by Visual Studio Code, plus additional keyboard shortcuts specific to Positron’s data science features. Some of those additional shortcuts are specific to R programming:

Shortcut Description

Insert the pipe operator (|> or %>%)1

Insert the assignment operator (<-)
, H Insert section

Load the current R package, if any, with devtools::load_all()

Build and install the current R package, if any

Test the current R package, if any

Check the current R package, if any

Document the current R package, if any
Tip

If you’d prefer to use keybindings as similar as possible to RStudio, learn how to enable them in Positron. This will overwrite some of Positron’s default keybindings, but will provide a more familiar experience for RStudio users.

You can create custom keyboard shortcuts as well.

Debugging

Positron supports a modern R debugging workflow with breakpoints, variables inspections, and more. See Debugging R code for details on setting breakpoints and stepping through your code.

Footnotes

  1. You can choose which pipe operator to insert via the positron.r.pipe setting.↩︎