installrequired: Require a list of packages, downloading and installing if...

View source: R/installrequired.R

installrequiredR Documentation

Require a list of packages, downloading and installing if necessary

Description

Convenient way to specify packages to attach, and install any that are not already installed. It only installs a package if that package is not already available locally.

Usage

installrequired(x, github, gitlatest = FALSE)

Arguments

x

vector of package names e.g., c("Hmisc", "data.table")

github

optional vector of user slash package names e.g., "rstudio/shiny" but those can just be in x now. If github = 'ej' it installs several specific ones from github (also see http://www.ejanalysis.com):

  • 'rstudio/shiny'

  • 'ejanalysis/analyze.stuff'

  • 'ejanalysis/ejanalysis'

  • 'ejanalysis/proxistat'

  • 'ejanalysis/ejscreen'

  • 'ejanalysis/ACSdownload'

  • 'ejanalysis/countyhealthrankings'

  • 'ejanalysis/UScensus2010blocks'

gitlatest

Optional logical, default is FALSE which means not downloaded from github if pkg of that name is already installed. If TRUE, download latest from github even if already installed.

Details

Uses require() and if necessary uses utils::install.packages() or install_github as explained in devtools::remote-reexports() If no parameters, prints an example.

Examples

  ## Not run: 
  installrequired('stringr')
  installrequired('rstudio/shiny')
  #
  installrequired(c('Hmisc' , 'ejanalysis/analyze.stuff'))
  # or
  installrequired('ej') # for several specific ones used in e
  
## End(Not run)

ejanalysis/analyze.stuff documentation built on April 2, 2024, 10:10 a.m.