We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.
It looks like you set up radian as your default R terminal. Just remove r.rterm.mac and r.rterm.option to restore using R terminal by default.
I'm running into the same issue. Ctrl+Enter in Rmarkdown chunks runs in radian as expected, but with .R scripts it opens a new terminal. Am I doing something wrong here? https://uploads.disquscdn.c...
Are you using "R: Create R terminal" command to start radian or starting your own radian in the vscode terminal manually?
I use to start by clicking "Attach Active Terminal" below, which calls .vsc.attach(). Gonna try with command pallet and typing radian on shell
In this case, you need to set "r.alwaysUseActiveTerminal": true in vscode settings so that it won't try to start a session if it has not started one.
Same :( https://uploads.disquscdn.c...
Found it! It was R Tools extension. Disabled it and now it works. Do you know that? I guess features are already covered by R and R LSP Client extensions
R Tools is another R extension. It might have some conflicts with vscode-R and vscode-r-lsp.
Looks fantastic! Thanks for sharing this!
Thanks - this is really useful
Hi, I realise this article is old but I was just wondering if it's possible to do this on a compute node? For me it works when I'm on a login node but not when I qrsh to a compute node. Thanks!
Nice article. How do you get plots to display within vscode itself? My plots are opening a new window. Thanks!
Could you confirm that you enabled "r.sessionWatcher" in vscode?
You might want to take a look at https://github.com/Ikuyadeu... and https://renkun.me/2020/06/1... for a nicer graphics device useful in vscode.
My "r.sessionWatcher" wasn't enabled. It's working fine now. Thanks.
Hi, thanks for this wonderful blog post. I tried to view a data frame in VS code but got this error:
Error in .External2(C_dataviewer, x, title) : unable to start data viewer
In addition: Warning message:
In View(smp.map) : unable to open display
I searched and found that pandas might be required, but I have pandas installed and the error persists. Do you have any idea how to solve this? Thanks in advance!
Looks like you did't enable r.sessionWatcher. You should set "r.sessionWatcher": true in vscode settings and reload vscode, then run command R: Create R terminal, and it should work then.
Yes that solves the problem, thanks!
I am new to VS Code and try to set it up as you descibed.
For a regular *.r-file everything works fine. But for a *.rmd-file highlighting the code in chunk is missing and I can not sent a code line to the terminal. I am not sure what I am doing wrong.
It would be great, if you can help me out. I like your work and appreciate you efforts.
Here is my settings.json
// ========== begin: use R in VS code ===
"r.bracketedPaste": true,
"r.lsp.path": "/usr/local/bin/R",
"r.rmarkdown.enableCodeLens": true,
"editor.codeLens": true,
"r.lsp.debug": true,
"r.lsp.diagnostics": true,
"r.rterm.option": [
"--no-save",
"--no-restore",
"--r-binary=/usr/local/bin/R"
],
"r.alwaysUseActiveTerminal": true,
"r.sessionWatcher": true,
"r.rterm.mac": "/Library/Frameworks/Python.framework/Versions/3.6/bin/radian",
// ========== end: use R in VS code ===
You might need the following settings to associate .rmd with rmd language to make it work:
"files.associations": {
"*.rmd": "rmd"
}
Thank you very much. Perfect.
Bro, is it possible to set plot size to match pane size as in RStudio? The only thing I miss right now is the "zoom viewer". Fixed size may be an issue when it affects some plot elements like arrows and annotations.
You may take a look at https://renkun.me/2020/06/1....
Duuuuuude, you're a life saver!
Thanks for the post! How did you get the plot history out? This is really fantastic!
If you are using the default png-based plot, you could run vscode command (Ctrl + P or F1) Show Plot History.
If you use httpgd (https://github.com/nx10/htt... as described at https://renkun.me/2020/06/1..., then plot history navigation is supported on the web page.
Thanks a lot!
非常好!Really amazing, thanks!
Thanks for the post! How did you get your plots and View outcome inside the vscode? Everything works fine for me except this feature. Do you use XQuartz?
Please take a look at https://github.com/Ikuyadeu.... I'm constantly working on this feature and the latest doc is at https://github.com/renkun-k... which is not yet merged to master but you should follow this.
Thanks a lot. It is a great extension, appreciate your work. I just tried the solution based on the session watcher. It works, however not exactly what I needed. I was hoping it would be possible to have the Quartz device window as one of the VSCode panel tab (so I can switch between plots, etc). But anyway, I think for most people the solution with PNG file preview will be good enough.
Please take a look at https://github.com/Ikuyadeu... and if you want to try it, please take a look at https://github.com/renkun-k... which provides testing builds that merges all my PRs in https://github.com/Ikuyadeu...
Thanks!
https://uploads.disquscdn.c... So I can start up radian as a terminal in vscode. However, when I press cmd+enter the code runs in the default R Interactive terminal rather than the python radian terminal. How would I go about making radian my default? I am new to vscode, so here is what my settings look like.