Switch to a different computing environment (set of installed R packages and library location paths for new pkg installs)
switchTo(
name,
seed = NULL,
reverting = FALSE,
ignoreRVersion = FALSE,
exclude.site = TRUE,
...
)# S4 method for character,character
switchTo(
name,
seed = NULL,
reverting = FALSE,
ignoreRVersion = FALSE,
exclude.site = TRUE,
...
)
# S4 method for character,SwitchrCtx
switchTo(
name,
seed = NULL,
reverting = FALSE,
ignoreRVersion = FALSE,
exclude.site = TRUE,
...
)
# S4 method for character,missing
switchTo(
name,
seed = NULL,
reverting = FALSE,
ignoreRVersion = FALSE,
exclude.site = TRUE,
...
)
# S4 method for SwitchrCtx,ANY
switchTo(
name,
seed = NULL,
reverting = FALSE,
ignoreRVersion = FALSE,
exclude.site = TRUE,
...
)
# S4 method for character,RepoSubset
switchTo(
name,
seed = NULL,
reverting = FALSE,
ignoreRVersion = FALSE,
exclude.site = TRUE,
...
)
# S4 method for character,PkgManifest
switchTo(
name,
seed = NULL,
reverting = FALSE,
ignoreRVersion = FALSE,
exclude.site = TRUE,
...
)
# S4 method for character,SessionManifest
switchTo(
name,
seed = NULL,
reverting = FALSE,
ignoreRVersion = FALSE,
exclude.site = TRUE,
...
)
Invisibly returns the SwitchrCtx object representing the new computing environment
The name associated (or to associate) with the computing environment.
The seed, indicating packages to install into a newly created package library No effect if the library already exists
Indicates whether we are reverting to the environment in use before the current one. Typically not set directly by the user.
Should the R version in use be ignored when checking for existing computing environmeSnts. This is experimental.
Should the Site library be excluded when creating
and switching to the specified library. Defaults to TRUE
Passed directly to makeLibraryCtx
if an existing
computing environment is not found.
If switchr does not now about the specified computing environment, a new one
will be created via installCompEnv. This includes
creating a directory under the switchr base directory and installing
packages into it. See installCompEnv
for more details.
This function has the side effect of unloading all loaded
packages (other than base packages, GRAN or GRANBAse, switchr itself, and
switchr's dependencies) and the associated DLLs. It also changes the library
location R will use to search for packages, e.g. when you call
library
.
This means you will have to reinstall packages after switching, which is important and intended (e.g. when switching to using Bioc devel from Bioc release).
Becker G, Barr C, Gentleman R, Lawrence M; Enhancing Reproducibility and Collaboration via Management of R Package Cohorts. Journal of Statistical Software, 81(1). 2017. doi: 10.18637/jss.v082.i01
makeLibraryCtx
if (FALSE) {
switchTo("mynewlibrary")
switchBack()
fdman = GithubManifest("gmbecker/fastdigest")
switchTo("fastdigestlib", seed = fdman)
}
Run the code above in your browser using DataLab