user1603472
user1603472

Reputation: 1458

How do you change the version of R running in Visual Studio 2017?

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.

Upvotes: 7

Views: 5217

Answers (2)

Hong Ooi
Hong Ooi

Reputation: 57686

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

Upvotes: 11

pwjvr
pwjvr

Reputation: 158

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

Upvotes: 8

Related Questions