Skip to content

Instantly share code, notes, and snippets.

View brentthorne's full-sized avatar

Brent Thorne brentthorne

View GitHub Profile
@brentthorne
brentthorne / ipak_dev.R
Last active September 19, 2021 16:13
Install and load multiple R packages at once using devtools:install_x() options
# ipak_dev function: install and load multiple R packages using 'devtools::install_' options.
# check to see if packages are installed. Install them if they are not, then load them into the R session.
#
# install_method = "github" is the default which creates "devtools::install_github('examplerepo/examplepackage')".
# "github" can be replaced with any of the default install options for devtools, such at c("git","bitbucket","cran","local" etc..
# NOTE not all of the options have been tested as I created this for my own personal use which is mainly through github.
#
# install_method = "base" is if you have a list of packages that are to be installed using the base install.packaes() function
#
# This script was adapted from the ipak function created by @stevenworthington