You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to build R environment in VScode. But the workspace region still showed nothing when I created R dataframe.
What I've done:
I created a r_env environment on Linux server for R analysis. I've installed R packages including httpgd, languageserver and radian. The versions are as below:
r-base 4.4.3 h9c32bc2_0 conda-forge
r-httpgd 2.0.4 r44h93ab643_0 conda-forge
radian 0.6.13 pypi_0 pypi
packageVersion('languageserver')
[1] ‘0.3.16’
My settings.json is as below:
{
"r.alwaysUseActiveTerminal": true,
"r.bracketedPaste": true,
"r.rterm.option": [
"--r-binary=/mnt/data/userdata/zhangliyin/anaconda3/envs/r_env/bin/R",
"--no-site-file"
],
"r.plot.useHttpgd": true,
"r.rterm.linux": "/mnt/data/userdata/zhangliyin/anaconda3/envs/r_env/bin/radian",
"r.rpath.linux": "/mnt/data/userdata/zhangliyin/anaconda3/envs/r_env/bin/R",
"r.workspaceViewer.removeHiddenItems": true,
"r.workspaceViewer.showObjectSize": true
}
I read some of similar issues and tried mentioned solutions, but the problem still remains. I would really appreciate your help! Thanks a lot!
I have had some similar problems. I could fix it when connecting to my local linux via WSL. I only partially solved the issue when connecting to the linux server, but the problem is that the server I use is divided into login and compute nodes. If yours is not the same way, then the following might help you:
Try switching "r.alwaysUseActiveTerminal": true to "r.alwaysUseActiveTerminal": false. When running codes, it will open a new "R Interactive" terminal. It should attach properly this way. If your server is divided into login and compute, then be careful, because it is likely launching the R terminal on the login node.
Another thing I noted from your post is that you installed httpgd via conda ("r-httpgd"), but languageserver seems to be installed via install.packages(). I guess this could create some problems as well, maybe not for Reditorsupport, but it will certainly be a problem if you ever try sharing your environment with others. Thus, I recommend installing all R packages via conda. Try removing the languageserver from within R and then install r-languageserver from conda-forge
@lgn-almeida Hi, may I ask what kinds of ways you use R in your local linux via WSL, through system-level R or R in conda env?
I have some problems in setting radian as the default console in vscode-R when using R in conda env (also, radian was installed in the conda env). If I set "r.rterm.linux" with directory of radian (like ${userHome}/../envs//bin/radian), it always return error message of exit code 1, even though remove "--no-save" and "--no-restore" parament in "r.rterm.option". Do you have any ideas?
Hi @Shijie-Jian. I also use R through conda, and in one of my environments, I do use radian. I can share with you my configs and a few things to check on your end.
First, I would navigate to your project folder in WSL (i.e., via the command line), load your conda environment and start radian. See if radian starts up properly via the command line. If it does load properly, then the fix must be on the VS Code side; otherwise, your Radian/conda installation might have a problem.
For VScode, here is how I use it:
First, I navigate to my project's root folder in WSL (cd projects/project1), then activate the conda env (conda activate myenv), and start VScode via the terminal (code .). This will launch VSCode on the project's root folder. In the project root, I create a ".vscode" folder, and inside of it I create a settings.json file with this inside.
I prefer to keep a .vscode folder and a settings.json per project as I can configure them independently (for instance, use a different conda env per project), but you can also set this globally and edit the global settings.json file.
It’s important to start VS Code from a terminal where your conda environment is already activated (for example, by running conda activate myenv and then launching VS Code with code .).
Doing this ensures that all terminals opened within VS Code automatically load the same conda environment.
If instead you open VS Code via the GUI (e.g., from the Start Menu) and then navigate to your project folder and activate the conda environment manually in one terminal, only that specific terminal will have the environment active.
To use radian in that terminal, you’ll need to set the following in your VS Code settings:
"r.alwaysUseActiveTerminal": true
Otherwise, VS Code will launch a new R terminal (r.term) that won’t have your conda environment active, meaning radian won’t be available.
In my setup, when I activate conda, the environment name is appended to my shell prompt.
For example:
Conda not active: lgn:~/projects/$
Conda active: (R_4.5.1) lgn:~/projects/$
However, if I activate conda in the terminal before launching VS Code, the active environment name no longer appears in the terminal prompt inside VS Code.
To fix this, I added the following lines to my bash configuration file (located in my home directory):
File: ~/.bashrc
if [ -n "$CONDA_DEFAULT_ENV" ]; then
conda activate "$CONDA_DEFAULT_ENV"
fi
Thanks for your reply.
When I followed your instruction "activate conda first, then launch vs code", the active conda env in the terminal (I used bash instead) inside vs code is base env, I found it okey as it just need to activate specific env manually.
Also, I want to mentioned that there is useful setting to link radian (within a conda env) in terminal to R Session watcher of vscode-R extension (in order to show used variables and their value). (https://github.com/REditorSupport/vscode-R/wiki/R-Session-watcher) (Advanced usage (for self-managed R [sessions))
Just modified .Rprofile file (created if it does not exist) in the project-root directory with setting described in the website above, and restart radian.
Glad to see the recent progress on this VS Code extension and ARF, especially the integration of R version switching, which is not currently available in radian. I have not used ARF myself yet, though.
@Shijie-Jian please try with v3.0.1 and arf (radian is no longer under active development). Also, please check the multiple issues regarding conda and double check your config. Thanks!
Activity
lgn-almeida commentedon Jun 6, 2025
I have had some similar problems. I could fix it when connecting to my local linux via WSL. I only partially solved the issue when connecting to the linux server, but the problem is that the server I use is divided into login and compute nodes. If yours is not the same way, then the following might help you:
Try switching
"r.alwaysUseActiveTerminal": trueto"r.alwaysUseActiveTerminal": false. When running codes, it will open a new "R Interactive" terminal. It should attach properly this way. If your server is divided into login and compute, then be careful, because it is likely launching the R terminal on the login node.Another thing I noted from your post is that you installed httpgd via conda ("r-httpgd"), but languageserver seems to be installed via
install.packages(). I guess this could create some problems as well, maybe not for Reditorsupport, but it will certainly be a problem if you ever try sharing your environment with others. Thus, I recommend installing all R packages via conda. Try removing thelanguageserverfrom within R and then installr-languageserverfrom conda-forgeShijie-Jian commentedon Nov 6, 2025
@lgn-almeida Hi, may I ask what kinds of ways you use R in your local linux via WSL, through system-level R or R in conda env?
I have some problems in setting radian as the default console in vscode-R when using R in conda env (also, radian was installed in the conda env). If I set "r.rterm.linux" with directory of radian (like ${userHome}/../envs//bin/radian), it always return error message of exit code 1, even though remove "--no-save" and "--no-restore" parament in "r.rterm.option". Do you have any ideas?
lgn-almeida commentedon Nov 11, 2025
Hi @Shijie-Jian. I also use R through conda, and in one of my environments, I do use radian. I can share with you my configs and a few things to check on your end.
First, I would navigate to your project folder in WSL (i.e., via the command line), load your conda environment and start radian. See if radian starts up properly via the command line. If it does load properly, then the fix must be on the VS Code side; otherwise, your Radian/conda installation might have a problem.
For VScode, here is how I use it:
First, I navigate to my project's root folder in WSL (
cd projects/project1), then activate the conda env (conda activate myenv), and start VScode via the terminal (code .). This will launch VSCode on the project's root folder. In the project root, I create a ".vscode" folder, and inside of it I create a settings.json file with this inside.Here is my folder structure:
I prefer to keep a .vscode folder and a settings.json per project as I can configure them independently (for instance, use a different conda env per project), but you can also set this globally and edit the global settings.json file.
Here is the content of settings.json:
It’s important to start VS Code from a terminal where your conda environment is already activated (for example, by running
conda activate myenvand then launching VS Code withcode .).Doing this ensures that all terminals opened within VS Code automatically load the same conda environment.
If instead you open VS Code via the GUI (e.g., from the Start Menu) and then navigate to your project folder and activate the conda environment manually in one terminal, only that specific terminal will have the environment active.
To use radian in that terminal, you’ll need to set the following in your VS Code settings:
Otherwise, VS Code will launch a new R terminal
(r.term)that won’t have your conda environment active, meaning radian won’t be available.In my setup, when I activate conda, the environment name is appended to my shell prompt.
For example:
However, if I activate conda in the terminal before launching VS Code, the active environment name no longer appears in the terminal prompt inside VS Code.
To fix this, I added the following lines to my bash configuration file (located in my home directory):
File: ~/.bashrc
Hope this helps!
Shijie-Jian commentedon Nov 18, 2025
Thanks for your reply.
When I followed your instruction "activate conda first, then launch vs code", the active conda env in the terminal (I used bash instead) inside vs code is base env, I found it okey as it just need to activate specific env manually.
Also, I want to mentioned that there is useful setting to link radian (within a conda env) in terminal to R Session watcher of vscode-R extension (in order to show used variables and their value). (https://github.com/REditorSupport/vscode-R/wiki/R-Session-watcher) (Advanced usage (for self-managed R [sessions))
Just modified .Rprofile file (created if it does not exist) in the project-root directory with setting described in the website above, and restart radian.
ThomasSoeiro commentedon Sep 23, 2026
Can you reproduce with vscode-r 3.0.0-rc.0?
@eitsupi @Fred-Wu @grantmcdermott can you please add the "need information" label?
ThomasSoeiro commentedon Sep 26, 2026
@eitsupi Should it be close like #1617 et al.?
eitsupi commentedon Sep 26, 2026
This is outdated, so I'm closing it.
Please let me know if you continue to experience problems.
Shijie-Jian commentedon Oct 1, 2026
Glad to see the recent progress on this VS Code extension and ARF, especially the integration of R version switching, which is not currently available in radian. I have not used ARF myself yet, though.
I was also able to reproduce the situation mentioned above with
vscode-r 3.0.0-rc.0and radian. In my setup, I followed this guide: https://renkun.me/2020/04/14/writing-r-in-vscode-working-with-multiple-r-sessions/ (hopefully it is still accessible).If I understand correctly, both of the approaches discussed above rely on environment variables to achieve the intended behavior.
ThomasSoeiro commentedon Oct 1, 2026
@Shijie-Jian please try with v3.0.1 and arf (radian is no longer under active development). Also, please check the multiple issues regarding conda and double check your config. Thanks!