其他分享
首页 > 其他分享> > R语言中批量安装R包

R语言中批量安装R包

作者:互联网

 

001、加载包测试

library(data.table)
library(ggplot2)
library(dplyr)
library(Seurat)
library(patchwork)

 

 

 

002、批量安装R包

packages <- c("data.table", "ggplot2", "dplyr", "Seurat", "patchwork")

for (i in 1:length(packages)) {
  if (!packages[i] %in% installed.packages()[,"Package"]) {
    install.packages(packages[i], dependencies = TRUE)
  }
}

 

标签:dplyr,语言,批量,patchwork,library,Seurat,安装
来源: https://www.cnblogs.com/liujiaxin2018/p/16421141.html