Sets R user library using .libPaths and R_LIBS_USER in .Renviron.

term_user_lib(libpath = NULL, dir = Sys.getenv("HOME"), overwrite = TRUE)

Arguments

libpath

Character string. User library path. If unspecified, defaults to {HOME}/R/{PLATFORM}/{R.VERSION} (${HOME}/R/%p/%v).

dir

Character string. .Renviron directory. Defaults to user's home directory.

overwrite

Logical. If .Renviron exists in dir, the variable R_LIBS_USER is overwritten with R_LIBS_USER="{libpath}". This argument is set to TRUE to ensure that the specified libpath is reflected in the .Renviron in dir.

Examples

if (FALSE) { term_user_lib( libpath = file.path(getwd(), "lib"), dir = getwd() ) }