View source: R/installrequired.R
installrequired | R Documentation |
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.
installrequired(x, github, gitlatest = FALSE)
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):
|
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. |
Uses require()
and if necessary uses utils::install.packages()
or install_github as explained in devtools::remote-reexports()
If no parameters, prints an example.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.