Change version of R in a script


I would like to know if there is a command (that I would put at the very beginning of my script) allowing to change version of R without passing by tools -> global option -> general

for example:

# Use this version of R at this path "C: \ Program Files \ R \ R-3.6.0 \"
# any code
# Reset the default version of R

Then when the script arrives at the end it throws a command that puts the default version of R back into tools -> global option -> general

I think you'd be better off to use the terminal to execute your script, rather than running it from R Studio.

I would recommend, on a Windows System, for instance

C:\Program Files\R\R-3.6.0\bin\Rscript.exe "path_to_your_script.R"

1 Like


Ok, thank for your help.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.