R/cron_job_dependencies.R

Defines functions install_depend

Documented in install_depend

#' Install Required covid19 Packages
#' @details Install the required packages for the cron job
#' @param verbose if TRUE, will show messages
#' 

install_depend <- function(verbose = TRUE){
  if(verbose) {
    message("Installing the supporting packages")
  }
  args <-
    readr::read_csv("https://raw.githubusercontent.com/Covid19R/covid19Rdata/master/data-raw/packages.csv", col_types = "cc") %>%
    dplyr::mutate(
      arg = glue::glue("{username}/{package}")
    ) %>%
    dplyr::pull(arg)
  for (a in args) {
    devtools::install_github(a, upgrade = "never")
    if(verbose){
      message(paste(a, "was installed", sep = " "))
    }
  }
 return(message("Done.."))  
}
Covid19R/covid19Rdata documentation built on Jan. 29, 2021, 10:51 p.m.