I am trying to set up R to work with Visual Studio code.
When i execute a line with the keys CTRL
+ENTER
I get the error "win32 can't use R".
I am following the advice laid out in this medium post where i have managed to install all the extensions but am unsure where to apply point "4. Finally add these lines in the settings.json of your editor"
I have seen the this post which describes (I think) how to update the settings.JSON but to be honest im not sure where and if this is the correct place to add the lines in the original post.
The JSON file on my PC looks like the below
{
"[json]": {
"editor.quickSuggestions": {
"strings": true
},
"editor.suggest.insertMode": "replace",
"gitlens.codeLens.scopes": [
"document"
]
}
}
Could someone point me in the right direction
Thanks
C/C++ support for Visual Studio Code is provided by a Microsoft C/C++ extension to enable cross-platform C and C++ development on Windows, Linux, and macOS.
When I had this error, I did the following with Win10Pro (20H2) and VSC 1.53.0-insider
C:\Program Files\R\R-3.6.2\bin\x64\R.exe
[CTRL]+','
to open your settings. In "Search Settings" type "R".Extensions > R
R > Rpath: Windows
[CTRL]+'S'
to save. Or when you close the "Settings" pane, I think it should save.Just to point out that @Andrew was correct with his last comment to his answer. At least on my Windows installation I had to put both paths in order to get rid of the "win32 can't use R" error, i.e. the path to R.exe shown in the screenshot plus the path to Rterm.exe at the entry R > Rterm: Windows
. Without the second entry the error persisted in my case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With