Attaches packages that are already installed. Names that are not found on the library search path are reported with suggested install.packages() or remotes::install_github() calls to run yourself; this function does not install packages (CRAN policy).

ipak(pkg_list, force_cran = FALSE, force_github = FALSE)

Arguments

pkg_list

A character vector of package names. GitHub sources use "user/repo"; the installed package name is the repository name (see basename()).

force_cran

Logical. Ignored (retained for backwards compatibility; this function does not install or update packages).

force_github

Logical. Ignored (retained for backwards compatibility).

Value

A data.frame with columns pkg_name (character), success (logical: whether require() attached the package), and version (character, NA when not loaded). Returned invisibly; summaries are printed via print() on subsets when rows exist.

Acknowledgment

ipak() was first developed by Steven Worthington and made publicly available here. This version only loads packages and suggests install commands for missing ones.

Examples

# \donttest{
pkg_list <- c("utils", "stats") # base packages — usually present
ipak(pkg_list)
#>  Successfully loaded:
#>  pkg_name version
#>     utils   4.5.3
#>     stats   4.5.3
# }