R_switch: Switch R framework version on Mac

View source: R/R_switch.R

R_switchR Documentation

Switch R framework version on Mac

Description

Switch R framework version on Mac

Usage

R_switch(
  version = R_frameworks(),
  reset = TRUE,
  openRStudio = TRUE,
  frameworkPath = "/Library/Frameworks/R.framework/",
  RStudioPath = "/Applications/RStudio.app/Contents/MacOS/RStudio"
)

Arguments

reset

if TRUE, the framework is changed back to the original framework version.

openRStudio

if TRUE, open an RStudio session with the new R framework version.

frameworkPath

the R.framework path, the default is "/Library/Frameworks/R.framework/" on Mac.

RStudioPath

RStudio path, the default is "/Applications/RStudio.app/Contents/MacOS/RStudio".

Version

R framework version to switch to

Examples

## Not run: 
# List all frameworks
fw = R_frameworks()
fw

# Current framework
cfw = R_currentFramework()
cfw

# Switch
R_switch(setdiff(fw, cfw)[1], reset = FALSE, openRStudio = TRUE)
R_switch(cfw, reset = FALSE, openRStudio = TRUE)

R_switch(setdiff(fw, cfw)[1], reset = TRUE, openRStudio = FALSE)

# Reset the initial framework
R_switch(cfw, reset = FALSE)

## End(Not run)

paodan/funcTools documentation built on April 1, 2024, 12:01 a.m.