Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Installation: Windows

asawattenepri edited this page May 29, 2026 · 24 revisions

vscode-R

Install vscode-R in VS Code by searching reditorsupport.r in extension marketplace.

If your R installation is from CRAN with default installation settings, especially Save version number in registry is enabled, as the following image shows:

image

Then the default settings should work out of the box. Otherwise, you may have to change r.rterm.windows to the path to your R executable, which will be executed on command Create R Terminal.

languageserver

languageserver is an implementation of the Language Server Protocol for R.

Run the following commands in R.

You may install the latest stable release from CRAN:

install.packages("languageserver")

or install the development version with the newest features:

remotes::install_github("REditorSupport/languageserver")

which requires Rtools to build.

You can also install the rmarkdown package and Pandoc rendering library to see formatted R help pages upon hover. Previews of function documentation without these dependencies will show a plain page.

rmarkdown can be installed with:

install.packages("rmarkdown")

Pandoc is automatically installed if you have RStudio on your machine. See the official installation guide here if you do not have RStudio.

radian

radian is highly recommended as the R terminal for interactive use.

Since radian is built with python, we need to install python first. Note that radian does not work with the python distributed by Microsoft Store (radian#120) before v0.5.4, we need to install the official version. Go to Python Releases for Windows and download the latest executable installer, e.g. Windows x86-64 executable installer.

image

Make sure Add Python 3.x to PATH is selected.

Then start a command prompt or Windows PowerShell terminal and type the following command to install radian via pip:

pip install -U radian

To locate the path to radian.exe, run the following command:

where.exe radian

Then the following VS Code settings should be updated to properly use radian as the default terminal. Put the path to radian.exe in r.rterm.windows with all \ replaced with \\. For example, if your radian is installed for user:

{
  "r.bracketedPaste": true,
  "r.rterm.windows": "C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python37\\Scripts\\radian.exe"
}

There is currently an issue with radian, so that it does not respect the "r.bracketedPaste". To fix this, type into an R terminal

file.edit(file.path("~", ".Rprofile"))

which will open your .Rprofile. simply add the following:

options(radian.auto_match = FALSE)
options(radian.auto_indentation = FALSE)
options(radian.complete_while_typing = FALSE)

radian.complete_while_typing should also be set to FALSE when sending a long function; otherwise, the code may hang for a few seconds at random points before continuing.

VSCode-R-Debugger

VSCode-R-Debugger is a VS Code extension that implements R debugging capabilities. It depends on vscDebugger.

  1. Install VSCode-R-Debugger extension in VS Code.
  2. Install vscDebugger package via
remotes::install_github("ManuelHentschel/vscDebugger")

httpgd

httpgd is an R package to provide a graphics device that asynchronously serves SVG graphics via HTTP and WebSockets. It enables the plot viewer based on httpgd in VS Code.

  1. Install httpgd from CRAN/r-universe

    install.packages("httpgd", repos = c("https://nx10.r-universe.dev", "https://cran.r-project.org"))
  2. Enable r.plot.useHttpgd in VS Code settings.

  3. Add the following code to your .Rprofile:

    if (interactive() && Sys.getenv("TERM_PROGRAM") == "vscode") {
      if ("httpgd" %in% .packages(all.available = TRUE)) {
        options(vsc.rstudioapi = TRUE)
        options(vsc.use_httpgd = TRUE)
        options(vsc.plot = FALSE)
        options(device = function(...) {
          httpgd::hgd(silent = FALSE)
        })
      }
    }

Troubleshooting WSL

The connection between VSCode and R may fail if an R session is started on Windows Subsystem for Linux (WSL/WSL2), but VSCode is started outside of the WSL environment (e.g. on plain Windows). For R to work, you must open VSCode on WSL with the code <directory> command so that VSCode "thinks" that it is inside the container.

See issue #910 for details.

Clone this wiki locally

Morty Proxy This is a proxified and sanitized view of the page, visit original site.