Skip to content

Latest commit

 

History

1,360 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

R Extension for Visual Studio Code

Release Development version CI

This VS Code extension provides support for the R programming language, including features such as R language service based on code analysis, interacting with R terminals, viewing data, plots, workspace variables, help pages, managing packages, and working with R Markdown documents. See the wiki for full documentation.

The R and R Markdown syntaxes are located in a sibling package vscode-R-syntax.

What's new in 3.0.0

v3.0.0 is a major release with faster, more reliable R session communication, powered by the sess package. The extension includes sess and prompts to install or update it when needed. See the changelog for other changes and upgrade notes.

Quickstart

  1. Install R (>= 3.4.0) on your system. On Windows, we recommend letting the installer write the R path to the registry.

  2. Install the languageserver package from R.

    install.packages("languageserver")
  3. Install the stable release of this extension from the VS Code Marketplace or the Open VSX Registry. This release requires VS Code 1.110 or later.

    code --install-extension REditorSupport.r

    Alternatively, you can test the latest development version by installing from GitHub:

    Install the development version

    The latest pre-release is rebuilt from every push to main. Download and install it:

    curl -fsSL -o vscode-R.vsix https://github.com/REditorSupport/vscode-R/releases/download/latest/vscode-R.vsix
    code --install-extension vscode-R.vsix
  4. Create an R file and start coding! (Click Yes if prompted to install sess.)

Recommended extras

Steps 1–3 above are all that's required to get started with R in VS Code. But we also recommend the following software for a fully optimized R + VS Code experience:

  • Install an interactive plotting backend for a better R graphics experience:

    • jgd: Lightweight JSON graphics device with native vscode-R integration.
    • httpgd: SVG-based graphics device served via HTTP and WebSockets.
  • arf: A modern R console with many features: syntax highlighting, multiline editing, vi/emacs keybindings, R version switching, etc. Successor to radian written in Rust.

  • Complementary VS Code extensions:

    • Quarto: the official Quarto plugin for VS Code.
    • VSCode-R-Debugger: enables VS Code's debugging facilities for R scripts.

For example, assuming that you have installed arf and jgd, your user settings.json might include:

{
    "r.consolePath": "arf",
    "r.bracketedPaste": true,  // recommended for arf (and radian)
    "r.plot.backend": "jgd"    // "auto" already prefers jgd, then httpgd
}

Please consult the relevant installation wiki pages for your OS (Windows | macOS | Linux) for more detailed instructions.

Features

Exploring data

Call View(x) to open a table. The viewer loads rows on demand and applies column filters and sorting in R across the full table.

  • Columns searches column names, shows or hides matching columns, and pins columns to either edge. Drag entries to reorder them. Row names stay pinned on the left.
  • Filters shows filter inputs below the headers. Press Enter to apply text and number filters; use the filter button for ranges, missing values, or combined conditions. Clear filters removes every column filter, including filters on hidden columns. The toolbar shows the matching and total row counts.
  • Columns fit the available width by default and adapt when the viewer is resized. Size to content sizes the currently displayed cells, up to 480 pixels, and keeps those widths; Fit width switches back to filling the viewer. Manually resized columns retain their widths while the remaining flexible columns share the space. Hover over a cell to see its full value.
  • Repeated View() calls for the same object retain the viewer's sizing mode, column layout, sorting, filters, and page size when the column names, order, and types are unchanged. Refreshed data starts on the first page. Reset view restores fit-width sizing, the default layout, filters, sorting, and configured page size.

Questions, issues, feature requests, and contributions

Releases

Packages

Used by

Contributors

Languages