Answered by:
R with Visual Studio Code

Question
-
Good morning, all -
Because of, I believe, a bit of overzealousness on the part of my employer's IT security policies, I am unable to use R Studio to its fullest. Well, barely past the basics, to put it another way.
There is a dll that needs to be installed to use ggplot functions, mutate, %>%, etc. that is being blocked by our IT security. So, R Studio is rather worthless.
But, then I came across Visual Studio Code and the R extensions available for it. Upon initial installation, I saw that it appeared to have all the current R libraries preloaded. So, I thought this might get me past the IT security block I've been beating my head against.
Unfortunately, it seems the extensions documentation presumes more knowledge of - well, something - than I have. For example, the usage instructions for Yuki Ueda's R extension says;
For Windows, set config r.rterm.windows to your R.exe Path like "C:\\Program Files\\R\\R-3.3.4\\bin\\x64\\R.exe";
OK. Config what? What config am I setting? Where do I find it?
So, I'm wondering if anyone here might have or know of some sort of basic tutorial I can reference that will tell me how to use R with Visual Studio Code. Something that will at least get me started and on the path to figuring this out.
Thanx in advance for any assistance!
Answers
-
So I don't have a tutorial, but I can help you with the config setting.
You set it in the settings.json file, which you find in: C:\Users\<username>\AppData\Roaming\Code\User:
"r.rterm.windows": <the_path_to_r.exe>
- Marked as answer by Adam Quark Tuesday, September 17, 2019 6:49 PM
All replies
-
So I don't have a tutorial, but I can help you with the config setting.
You set it in the settings.json file, which you find in: C:\Users\<username>\AppData\Roaming\Code\User:
"r.rterm.windows": <the_path_to_r.exe>
- Marked as answer by Adam Quark Tuesday, September 17, 2019 6:49 PM
-
So I don't have a tutorial, but I can help you with the config setting.
You set it in the settings.json file, which you find in: C:\Users\<username>\AppData\Roaming\Code\User:
"r.rterm.windows": <the_path_to_r.exe>
Thanx, nielsb!
Before I commit - and, going by what I've seen elsewhere - am I correct that the settings.json file should look like this?
{ "r.rterm.windows": "C:\\Program Files\\R\\R-3.6.1\\bin\\x64\\Rterm.exe", "files.associations": { "*.rmd": "markdown" } }
-
-
That looks OK.
Eggselent! Seems to be working. It's not as good as R Studio, but it works without having to install any libraries.
Thanx, nielsb!
-
Glad you got it to work!