diff --git a/main.R b/main.R index 6dbca89..6e75e65 100644 --- a/main.R +++ b/main.R @@ -1,28 +1,13 @@ -# 列出所需的包 -packages <- c("ComplexHeatmap", "circlize", "RColorBrewer", "dendextend", "dendsort", "gridBase") - -# 检查并安装缺失的包 -install_if_missing <- function(pkg) { - if (!requireNamespace(pkg, quietly = TRUE)) { - if (pkg == "ComplexHeatmap") { - if (!requireNamespace("BiocManager", quietly = TRUE)) { - install.packages("BiocManager") - } - BiocManager::install("ComplexHeatmap") - } else { - install.packages(pkg, dependencies = TRUE) - } - } -} - -# 应用函数到每个包 -sapply(packages, install_if_missing) - -# 加载所有包 -lapply(packages, library, character.only = TRUE) +library(grid) +library(ComplexHeatmap) +library(circlize) +library(RColorBrewer) +library(dendextend) +library(dendsort) +library(gridBase) # 加载绘图数据 -data <- read.table(file = 'E:/hui.zhang/Drawpic/1.csv', header = TRUE, row.names = 1, sep = ',') +data <- read.table(file = 'D:/code/R/1.csv', header = TRUE, row.names = 1, sep = ',') # 查看数据 head(data) @@ -97,4 +82,5 @@ circos.track(track.index = get.current.track.index(), panel.fun = function(x, y) } }, bg.border = NA) -circos.clear() \ No newline at end of file +circos.clear() +