Skip to content

Instantly share code, notes, and snippets.

@yu-iskw
Created June 19, 2015 03:56
Show Gist options
  • Save yu-iskw/b727ad7c515eb790f971 to your computer and use it in GitHub Desktop.
Save yu-iskw/b727ad7c515eb790f971 to your computer and use it in GitHub Desktop.
How to install a package which is not installed
if (!require(pkg)){ 
        install.packages(pkg) 
} 
if ("somepackage" %in% row.names(installed.packages())  == FALSE) 
install.packages("somepackage") 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment