自动批量安装加载cran, bioconductor和github三个平台的所有的R包
R包管理
自动批量安装加载cran, bioconductor和github三个平台的所有的R包
自动安装cran,bioconductor和github三个平台的R包
auto_install <- function( cran.pkgs=NULL,bio.pkgs=NULL,git.pkgs=NULL){
library( stringr)
if( !is.null( cran.pkgs)){
new.cran.pkgs <- cran.pkgs[!(cran.pkgs %in% installed.packages()[,"Package"])] #检查要使用的分析包哪些包还没有安装
if(length(new.cran.pkgs)>0){
install.packages(new.cran.pkgs) #安装那些还没有安装的包
}
}
if( !is.null( bio.pkgs)){
new.bio.pkgs <- bio.pkgs[!(bio.pkgs %in% installed.packages()[,"Package"])] #检查要使用的分析包哪些包还没有安装
if(length(new.bio.pkgs)>0){