source("http://bioconductor.org/biocLite.R") major <- as.numeric(R.Version()$major) minor <- as.numeric(R.Version()$minor) if (major == 2 && (minor >= 12 && minor < 13)) { ##ok } else { stop("You must be running R version 2.12") } courseRepos <- "http://bioconductor.org/course-packages" allRepos <- c(courseRepos, biocinstallRepos()) allPkgs <- c("SeattleIntro2010","Biobase", "affy", "genefilter", "limma", "multtest", "arrayQualityMetrics", "IRanges", "GenomicRanges", "rtracklayer", "biomaRt", "GenomicFeatures", "Biostrings", "BSgenome", "Rsamtools", "ShortRead", "DESeq", "ALL", "hgu95av2.db", "GO.db", "org.Hs.eg.db", "BSgenome.Scerevisiae.UCSC.sacCer2", "org.Sc.sgd.db", "lattice") ## "lite" install: ##allPkgs <- c("hgu95av2.db", "org.Hs.eg.db", "RSQLite", "DBI", "AnnotationDbi", ## "genefilter", "ALL", "Biobase", "lattice", "SeattleIntro2010", ## "KernSmooth", "annotate", "xtable") handleError <- function(e) { msg <- paste("ERROR: R does not have permission to update ", "certain installed packages.\n", "Solutions:\n", "1) Run R as a user with administrative privileges.\n", "2) Reinstall R in a location (such as your home directory)\n", " where administrative privileges are not required.", sep="") stop(msg) } tryCatch(update.packages(repos = allRepos, ask = FALSE),error=handleError) newPkgs <- setdiff(allPkgs, installed.packages()) if (length(newPkgs) > 0) install.packages(newPkgs, repos = allRepos)