please_install | R Documentation |
Load a library, install it first if necessary.
please_install(lib, update = FALSE)
lib |
String name of a library to check/install. |
update |
Update packages? |
This was taken from: http://sbamin.com/2012/11/05/tips-for-working-in-r-automatically-install-missing-package/ and initially provided by Ramzi Temanni.
0 or 1, whether a package was installed or not.
[BiocManager] [install.packages()]
## Not run:
require.auto("ggplot2")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.