Skip to content

Installation: Linux

Elian H. Thiele-Evans edited this page Mar 2, 2024 · 11 revisions

vscode-R

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

If your R installation is from CRAN, then the default settings should work out of the box. Otherwise, you may have to change r.rterm.linux 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")

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. It requires Python which should be available on most Linux distributions out of the box.

To install it globally:

pip install -U radian

Or if you don't have root privilege, you may want to install it only for yourself:

pip install --user radian

You may run which radian to see where your radian executable is located.

Then the following VS Code settings should be updated to properly use radian as the default terminal. If your radian is installed only for user:

{
  "r.bracketedPaste": true,
  "r.rterm.linux": "/home/user/.local/bin/radian"
}

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.