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)
A character vector with the package names. Github packages needs to be listed as usual: "username/repo"
logical. If force the installation of cran packages
logical. If force the installation of github packages
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.
if (FALSE) {
pkg_list <- c("vegan", "ggplot2", "trinker/textclean", "jalvesaq/colorout")
ipak(pkg_list)
}