Created
May 15, 2018 22:07
-
-
Save allenh1/9ca96b09d74a6b163ac2f4e394d4fbc1 to your computer and use it in GitHub Desktop.
How to check if something is installed in R
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
| check.installed <- function(pkgname) { | |
| is.element(pkgname, installed.packages()[ , 1]) | |
| } | |
| ## Verify that mosaic is installed! | |
| if (!check.installed("mosaic")) { | |
| install.packages("mosaic"); | |
| } | |
| library(mosaic) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment