GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • vscode-R
  • Getting Started
  • Windows
  • macOS
  • Linux
  • VS Code Marketplace
  • Open VSX
  • Changelog
  • Extension settings
  • Keyboard shortcuts
  • Code linting
  • Recommended extensions and configuration
  • Working with renv-enabled projects
  • R Language Service

This view

  • Original page
  • New address

GeezerVison is showing reditorsupport.github.io — Getting Started | R Extension for Visual Studio Code

Getting Started ​

For many R users, RStudio has long been a great integrated development environment for data analysis and visualization. It provides a rich set of features that make it unprecedentedly easy to perform a wide range of tasks interactively.

VS Code, in contrast, is not specifically designed for a certain programming language. It is highly customizable through settings, and highly extensible through extensions. It supports many programming languages at different levels through language extensions that implement some common protocols such as the Language Server Protocol to enable language features based on code analysis such as Go To Definition and Rename symbol, and the Debug Adapter Protocol to enable interactive debugging of any target.

This vscode-R extension is an extension that attempts to make it easier to write R code and work with R sessions interactively in VS Code. Though vscode-R provides support emulating RStudio's features, it is not intended to be a full drop-in replacement for RStudio. In contrast, vscode-R is useful for those who want a unified development environment to work with multiple programming languages such as R, Python, C++, etc., as well as those who need to work with remote servers, containers, self-managed R sessions or multiple R sessions at the same time.

vscode-R requires VS Code 1.101 or later. To enjoy the full R development experience, install the extension and language server, then choose any optional tools you need:

  • vscode-R: Provides R language service, R Markdown, and interactivity between VS Code and R terminals. When first creating a managed R terminal, accept the prompt to install the bundled sess R package; it does not need to be installed manually.

  • languageserver: An R package that implements the Language Server Protocol for R to provide a wide range of language analysis features such as auto-completion, function signature, documentation, symbol highlight, document outline, code formatting, symbol hover, diagnostics, go to definition, find references, etc.

  • arf (optional): An alternative R console. See its repository for installation and configuration.

  • VSCode-R-Debugger: A VS Code extension to support R debugging capabilities.

  • jgd or httpgd (optional): Interactive graphics devices used by the plot viewer. The default r.plot.backend value, auto, tries jgd first, then httpgd, then the standard viewer.

  • rmarkdown: An R package and format for creating reproducible and narrative-driven data analyses. vscode-R provides tooling to edit, run, and knit Rmarkdown files.

  • Pandoc (optional): A powerful document conversion tool. vscode-R uses this to render help previews when users hover over R code.

However, the astounding flexibility of VS Code comes at a cost that some users might not find enjoyable in the beginning: Some setup and configuration are needed to make each part work well together. To minimize that cost, please refer to the detailed installation instructions we provide for Windows, macOS and Linux.

Install the extension ​

Install the stable release from the VS Code Marketplace or the Open VSX Registry, or from the command line:

sh
code --install-extension REditorSupport.r

Then install the languageserver R package:

r
install.packages("languageserver")

Create an R file and start coding. When prompted, click Yes to install the bundled sess package.

Release channels ​

ChannelPublishedHow to install
StableWhen a version is taggedVS Code Marketplace or Open VSX Registry
Daily pre-releaseDaily from mainSwitch to Pre-Release Version on the extension's page in VS Code
Development buildAfter each verified push to mainThe vscode-R.vsix file attached to the latest GitHub release

Choose Switch to Release Version on the extension's page to return to stable releases.

The development build is not published to a registry. Download and install it manually:

sh
curl -fsSL -o vscode-R.vsix https://github.com/REditorSupport/vscode-R/releases/download/latest/vscode-R.vsix
code --install-extension vscode-R.vsix

The latest release is replaced on each update, so note the extension version and the commit it was built from when reporting a problem.

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.