7

I would like to run R version 3.4 instead of the current, 3.3.2, and don't really know where to begin.

Web searches left we with little, perhaps, though, because I am not used to working on the Windows 10 platform and don't fully understand how the components in Visual Studio are layered.

Hong Ooi
  • 56,353
  • 13
  • 134
  • 187
user1603472
  • 1,408
  • 15
  • 24

2 Answers2

10

RTVS should detect all the versions of R you've got installed on your machine, in which case @pwjvr's answer is correct. You should be able to click on the workspace item in the corner and choose a different version to switch to. A "workspace" is what RTVS calls a specific R installation that can be used to run your code.

In the situation where RTVS doesn't detect R, you can add it manually. Go to the workspace window (R Tools -> Windows -> Workspaces). This should pop up a window like the one below.

enter image description here

Click on Add, and fill in the entries:

  • Entry name: name you want to give this workspace
  • Host URL or path: location of the R install, eg C:\Program Files\R\R-3.4.1
  • R command line arguments: any arguments to pass to the R binary. Generally you can leave this blank.

enter image description here

Hong Ooi
  • 56,353
  • 13
  • 134
  • 187
  • I just tried adding the newest version of Microsoft R Open 4.0.2 to Visual Studio 2017 that way, as the version I was using (Microsoft R Client 3.5.2.0) seems to not be able to get the most recent versions of some packages, but when I follow your instructions to add it I get the following error: "Connecting to R Workspace failed. Reason: No R interpreters installed." – coip Feb 12 '21 at 22:28
8

I hope this answers your questions.

In the bottom right of the VS console there will most likely stand R 3.3.2, if you click on it, a menu will pop up, allowing you to switch between the different versions available on your machine.

enter image description here

You will see in the bottom right, he is running Microsoft R Open 3.3.2, this is where you click to change versions

Hong Ooi
  • 56,353
  • 13
  • 134
  • 187
pwjvr
  • 148
  • 6