Learn R Programming

dipsaus (version 0.1.6)

prepare_install: Install Packages at Next Startup

Description

Register temporary code that will install packages at next session. The code will be automatically removed once executed.

Usage

prepare_install(
  packages,
  update_all = FALSE,
  restart = FALSE,
  repos = getOption("repos")
)

prepare_install2(packages, restart = FALSE, repos = getOption("repos"), ...)

Arguments

packages

characters, vector of package names

update_all

whether to update all installed packages before installation; default is false

restart

whether to restart session automatically

repos

repositories to search for packages

...

internal arguments

Value

None

Details

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.