Register temporary code that will install packages at next session. The code will be automatically removed once executed.
prepare_install(
packages,
update_all = FALSE,
restart = FALSE,
repos = getOption("repos")
)prepare_install2(packages, restart = FALSE, repos = getOption("repos"), ...)
characters, vector of package names
whether to update all installed packages before installation; default is false
whether to restart session automatically
repositories to search for packages
internal arguments
None
prepare_install
is soft-deprecated, use prepare_install2
instead.
Installing packages in R session could require restarts if
a package to be updated has been loaded. Normally restarting R
fixes the problem. However, under some circumstances, such as with a
startup code in profile, restarting R might still fail the
installation. prepare_install2
starts a new session with clean
environments for installation.