Created
January 18, 2020 08:49
-
-
Save stevecondylios/edc66af836beab93db54f35664376d60 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# init.R | |
# | |
# Example R code to install packages if not already installed | |
# | |
my_packages = c("tidyverse", "shiny") | |
install_if_missing = function(p) { | |
if (p %in% rownames(installed.packages()) == FALSE) { | |
install.packages(p) | |
} | |
} | |
invisible(sapply(my_packages, install_if_missing)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment