Skip to content

Instantly share code, notes, and snippets.

@monkeycycle
Created September 15, 2023 16:03
Show Gist options
  • Save monkeycycle/7a6959c3a709a5a4ed8866417fc5a472 to your computer and use it in GitHub Desktop.
Save monkeycycle/7a6959c3a709a5a4ed8866417fc5a472 to your computer and use it in GitHub Desktop.
R install and load necessary packages
# List of packages for session
package_list = c('devtools',
'here',
'tidyverse',
'janitor',
'magrittr',
'parsedate')
# Install CRAN packages (if not already installed)
installed_packages <- package_list %in% installed.packages()
if(length(package_list[!installed_packages]) > 0) install.packages(package_list[!installed_packages])
# Load packages into session
lapply(package_list, require, character.only=TRUE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment