The extensions to install:
- R (https://marketplace.visualstudio.com/items?itemName=Ikuyadeu.r)
- R LSP Client (https://marketplace.visualstudio.com/items?itemName=REditorSupport.r-lsp)
- R Tools (https://marketplace.visualstudio.com/items?itemName=Mikhail-Arkhipov.r)
For R LSP, you need to have R language server installed.
In VS Code open an R terminal and run:
- install.packages("languageserver")
Aleternatively, you can run the above command in R Studio.
R LSP lintr needs to be disabled as its settings are difficult to configure. Instead, you can use R linting, which is configurable through VS Code settings.
To disable R LSP lintr:
- Go the settings: R Lsp: Debug
- Disable it
Change the settings of R linting:
- Go to R > Linting
- Change any settings, such as "Max line length" to 120.
Radian provides a more powerful terminal, in comparison to the default R interactive.
- To install it, follow the instructions at https://github.com/randy3k/radian
- VS Code settings:
- Turn on r.bracketedPaste
- Set r.rterm.windows to your Radian path
- Examples:
C:/Users/ryan.behdad/AppData/Local/Continuum/anaconda3/envs/tf/Scripts/radian.exe
C:/Users/ryan.behdad/Miniconda3/envs/nostra/Scripts/radian.exe