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) } }