-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlibs.R
82 lines (64 loc) · 2.7 KB
/
libs.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#Radyant libs
libs <- c("shiny", "knitr", "Hmisc", "car", "tools", "gridExtra", "markdown", "R.utils", "psych", "rela",
"plyr", "reshape2", "vegan", "ggplot2", "lubridate", "pander","wordcloud")#"arm",
#Devium Libs
libs2 <- c("impute","WGCNA","RJSONIO","pwr","shiny", "car", "AER", "Ecdat", "foreign", "tools", "ggplot2",
"gridExtra", "reshape2", "plyr", "markdown", "R.utils", "psych", "rela", "xts","fdrtool","pls",
"qvalue","pcaMethods","shiny","hexbin","RColorBrewer","shinyBS","httr","jsonlite","Rcpp","shinybootstrap2") #"arm",
libs<-unique(c(libs,libs2))
# #function to load from bioconductor
# #function to check for packages and attempt to download if not found
# check.get.packages<-function(pkg)
# {
# options(warn=-1)
# # #make sure bio conductor is one of the repositories
# # #will need a mechanism to make sure this stays upto date
# # if(!all(names(getOption("repos"))%in%"BioCsoft"))
# # {
# # r<-getOption("repos")
# # r["BioCsoft"]<-"http://www.bioconductor.org/packages/2.11/bioc" # needs to be specific version
# # options(repos = r)
# # #add layer to call
# # #source("http://bioconductor.org/biocLite.R")
# # #biocLite("package to install")
# # if install fails
# # #r.version<-paste(sessionInfo()$R.version$major,sessionInfo()$R.version$minor, sep=".")
# # #bioc.url<-paste("http://www.bioconductor.org/packages/",r.version,"/bioc", sep="")
# # #r["BioCsoft"]<-bioc.url # needs to be specific to R version
# # #options(repos = r)
# # }
# res<-character()
# need<-as.matrix(sapply(1:length(pkg),function(i)
# {
# if(require(pkg[i],character.only = TRUE)==FALSE)
# {
# res<-c(res,pkg[i])
# }
# }))
# need<-as.character(unlist(need[!is.null(need)]))
# if(length(need)>0)
# {
# x<-sapply(need,install.packages)
# lib.fun<-function(need){
# sapply(1:length(need), function(i){
# out<-tryCatch(library(need[i], character.only= TRUE), error=function(e){need[i]})
# if(all(out==need[i])){need[i]}
# })
# }
# out<-as.character(unlist(lib.fun(need)))
# #try bioconductor
# if(length(out)>0){
# cat(paste("Package not found, trying Bioconductor..."),"\n")
# source("http://bioconductor.org/biocLite.R")
# lib.fun.bioc<-function(need){
# sapply(1:length(need), function(i){
# tryCatch( biocLite(need[i]),
# error=function(e){need[i]})
# })
# }
# tmp<-lib.fun.bioc(out)
# final<-lib.fun(tmp)
# if(length(final)>0){cat(paste("could not find package: ",paste(as.character(unlist(final)),collapse=", "),sep=""),"\n")}
# }
# }
# }