R (>= 3.4.0) should be installed via conda (miniconda or anaconda)
Install “radian”, via conda, as an alternative interface for default R (strongly recommended)
After “radian” is installed, add this line in .bashrc or .bash_profile
alias r="radian"
Install following packages (always try to install R packages via conda first):
For example:
conda install -c conda-forge r-languageserver
If the required package cannot be found on conda, try to install from github (devtools packages is required)
Create or add the following lines to “~/.Rprofile”
source(file.path(Sys.getenv(
if (.Platform$OS.type == "windows") "USERPROFILE" else "HOME"
), ".vscode-R", "init.R"))
Create or add the following contents to “~/.vscode/settings.json”
{
"r.rpath.linux": "[link_to_R_execute_file]",
"r.rterm.linux": "[link_to_R_execute_file]"
"files.associations": {
"*.Rmd": "rmd"
}
}
NOTE:
Extension for remote SSH connection
For Mac OS (and linux): should add all SSH configurations in : /Users/[idname]/.ssh/config
Sample of config file:
Host *
ServerAliveInterval 300
ForwardAgent yes
ForwardX11 yes
ForwardX11Trusted yes
XAuthLocation /opt/local/bin/xauth
Host [Host_address_1]
HostName [Host_name_1]
User [User_name]
Compression yes
Ciphers aes128-ctr,aes128-cbc
Host [A_host_address_jump_from_Address_1]
Hostname [Host_name_2]
ProxyJump [Host_address_1]
Host [A_special_host_address]
HostName [A_special_host_name]
UserKnownHostsFile=/dev/null
StrictHostKeyChecking=no
TRICK: Setup ssh connection without password
Press F1 to open “settings.json”
The following options MUST be noticed:
Other options can be found in below example of “settings.json”
{
"workbench.iconTheme": "vscode-icons",
"workbench.editor.highlightModifiedTabs": true,
"r.alwaysUseActiveTerminal": true,
"r.bracketedPaste": true,
"r.sessionWatcher": true,
"r.lsp.diagnostics": false,
"r.plot.useHttpgd": true,
"editor.minimap.enabled": false,
"editor.renderWhitespace": "all",
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"editor.fontSize": 13,
"editor.letterSpacing": -0.5,
"editor.cursorStyle": "underline",
"editor.quickSuggestions": {
"comments": "off",
"strings": "off",
"other": "off"
},
"editor.acceptSuggestionOnEnter": "off",
"editor.quickSuggestionsDelay": 10,
"editor.wordBasedSuggestions": false,
"editor.suggestOnTriggerCharacters": false,
"editor.parameterHints.enabled": false,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"terminal.integrated.fontFamily": "Fira Code",
"terminal.integrated.fontSize":12,
"terminal.integrated.gpuAcceleration": "off",
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 13000,
"workbench.colorTheme": "Dracula",
"vsicons.dontShowNewVersionMessage": true,
"editor.rulers": [
80
],
"remote.SSH.connectTimeout": 131,
"remote.SSH.remotePlatform": {
"101.96.72.101": "linux"
},
"window.zoomLevel": -0.28133422777602873,
"workbench.layoutControl.enabled": false,
"window.commandCenter": false,
}