r - 制作热图时 hclustfun(distMatrixR, method = method) 出错
问题描述
我正在尝试使用 pastebin 中的以下数据创建热图:https ://pastebin.com/rZE0nEmc 。但是我在 hclustfun(distMatrixR, method = method) 中收到错误错误:外部函数调用中的 NA/NaN/Inf (arg 10) 另外:警告消息:在 cor(t(x), use = "pa") :标准偏差为零,我无法解决问题。我附上了我目前拥有的代码
library("gplots")
library("heatmap3")
library("RColorBrewer")
library("readxl")
colfunc <- colorRampPalette(c("mistyrose", "red"))
Data <- read_excel("TE_polymophism.xlsx")
# N=100
# Data <- Data[sample(nrow(Data), N), ]
# Data <- Data[order(Data$svtype),]
Data <- Data[,2:ncol(Data)]
Data <- log2(Data+1)
colnames(Data) <- c("AraucanaWhite","Cornell2", "ACRB30Weeks", "Luoyangwu","RedJungleFowl", "Tibetan")
Data_final <- as.matrix(Data)
pdf("TE_polymophism.pdf", height = 10, width = 10)
par(oma=c(1,1,1,1))
heatmap3(Data_final,
Colv=T, #To keep the column order (sample order), cluster the genes
scale="none",
hclustfun = ,
labRow=" ",
cexCol = 0.9,
key=TRUE,#Show color key
density.info="none",trace="none", na.rm=TRUE)
dev.off()
解决方案
推荐阅读
- python - 在 python 中为许多字典中的每一个打开文件
- android - 如何在 gradle 中运行其他 gradle 命令
- go - 每个前端的 Traefik 转发身份验证
- php - Laravel 调度程序延迟运行(不准时)
- django - * 之后的 _reverse_with_prefix() 参数必须是可迭代的,而不是 int
- php - Web 开发中的预定事件
- raspberry-pi - 树莓派 3 上的 Tizen 3.0
- php - Laravel - 视图中的多个控制器
- html - 移动网站 URL 的 Swift HTML 内容
- ruby-on-rails - 如何找到客户和用户参与 Ruby on Rails 的所有项目