Description Usage Arguments Value Examples
Load packages you need; optionally install them if they're not already installed
1 2 | load_required_packages(required_packages,
try_installing_if_not_present = TRUE)
|
required_packages |
A character vector of the quoted names of packages
you'd like loaded via the |
try_installing_if_not_present |
Should the function try to install any
of your dependencies if need be? This setting is useful if you know what
your code requires, but you can't safely assume which (if any) of your
required packages will be installed on a user's system. Defaults to
|
an invisible copy of the dependencies you passed in
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | load_required_packages(c("boot", "MASS"))
# If you wish to be super-careful,
# you can say NO to automatic package installation.
# If you say no, the function will only try to load your requirements;
# it won't attempt to install anything new even if the package
# you're requiring isn't currently installed
load_required_packages("utils", try_installing_if_not_present = FALSE)
## Not run: #
https://github.com/hadley/tidyverse
some_packages_from_the_tidyverse <- c( "ggplot2"
, "tidyr"
, "broom" )
load_required_packages(some_packages_from_the_tidyverse)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.