-
Notifications
You must be signed in to change notification settings - Fork 0
HPC and R VScode
Paul Sastourné-Haletou edited this page Nov 27, 2024
·
2 revisions
Author: Paul
Date: 11/27/24
This guide explains how to set up and use R in VSCode while connecting to an HPC environment.
Install the R VScode extension in VSCode: https://code.visualstudio.com/docs/languages/r
Update R terminal settings:
Define R path:
Update the path directly in the R extension settings. Make sure you are editing the settings for your remote VSCode instance, as shown at the top of the screenshot:
Alternatively, update the .vscode/settings.json file:
{
"r.rterm.linux": "/path/to/R",
"r.lsp.path": "/path/to/R"
}Add the following lines to .Rprofile:
Sys.setenv(TERM_PROGRAM = "vscode")
source("/path/to/your/.vscode-R/init.R")conda activate r_env
R.vsc.attach()** Use tmux for Persistent Sessions: **
-
Create a new
tmuxsession:tmux new -s r_session
-
List all sessions:
tmux ls
-
Reattach to a session:
tmux attach -t r_session
🧪 Ruggles Lab Wiki
🔗 Quick Links: • Lab GitHub Repository • Lab Website