Skip to content
Snippets Groups Projects
Commit ffacca84 authored by bow's avatar bow
Browse files

Add conditional installation of required packages in aggr_base_count.R

parent edc53ef9
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,19 @@
# (c) 2013 by Wibowo Arindrarto [LUMC - SASC]
# Adapted from Peter-Bram 't Hoen's script: 'merge_table_script_shark_PH3.r'
# General function to install package if it does not exist
# Otherwise, it only loads the package
usePackage <- function(p) {
r <- getOption("repos")
r["CRAN"] <- "http://cran.us.r-project.org"
options(repos = r)
rm(r)
if (!is.element(p, installed.packages()[,1]))
install.packages(p, dep = TRUE)
require(p, character.only = TRUE)
}
usePackage("getopt")
## FLAGS ##
LEVELS <- c('gene', 'exon')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment