Skip to content

Installation: Windows

Kun Ren edited this page Mar 16, 2020 · 20 revisions

1. vscode-R

Install vscode-R in VSCode by searching ikuyadeu.r in extension market place.

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.

If you are interested in the experimental features provided by R session watcher, you may enable it in the VSCode settings:

{
  "r.sessionWatcher": true
}

2. 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.

3. vscode-r-lsp

Install vscode-r-lsp in VSCode by searching reditorsupport.r-lsp in extension market place.

If the R installation is from CRAN as decribed in the first section, then the default settings should work out of the box. Otherwise, you may have to change r.lsp.path to the path to your R executable, which will be executed to start the R Language Server as a background process.

4. 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), 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 VSCode 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"
}