Skip to content

Instantly share code, notes, and snippets.

#check for and/or install dependencies
need<-c("RCurl","ggplot2","gridExtra","reshape2")
for(i in 1:length(need)){
if(require(need[i], character.only = TRUE)==FALSE){ install.packages(need[i]);library(need[i], character.only = TRUE)} else { library(need[i],character.only = TRUE)}
}
if(require(pcaMethods)==FALSE){
need<-c('Rcpp', 'rJava',
'Matrix', 'cluster', 'foreign', 'lattice', 'mgcv', 'survival')
for(i in 1:length(need)){