ipak() checks if the package is installed and then loads it. If the package is not installed, then ipak() installs it and then loads it. ipak() is capable of handling CRAN and github packages. In addition, the user can update their packages using the force_*() arguments.

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

Arguments

pkg_list

A character vector with the package names. Github packages needs to be listed as usual: "username/repo"

force_cran

logical. If force the installation of cran packages

force_github

logical. If force the installation of github packages

Acknowledgment

ipak() was first developed by Steven Worthington and made publicly available here. I've been using this function for years and now I decided to expand it.

Examples

if (FALSE) {
pkg_list <- c("vegan", "ggplot2", "trinker/textclean", "jalvesaq/colorout")
ipak(pkg_list)
}