使用Heatmap2功能在R中。获取错误消息:PAR中的错误(OP):图形参数PIN的无效值

发布于 2025-02-04 13:20:46 字数 1269 浏览 2 评论 0原文

我正在使用R中的热图并使用Heatmap2函数来创建相关热图。昨晚我创建了一个热图,很好。我只错过了添加一个变量“体育参与”,然后又回来添加它,现在它不起作用,并向我显示此错误:

.external.graphics中的错误.integer(num.figures),: 无效的图形状态 PAR(OP)中的错误:为图形参数“ PIN”指定的无效值

这是我的代码:

labvec <- c(rep("ACE Score"))

labvec[c("Bully-Victim","Family Resilience",
     "TBI","Child's Sex","Child's Age",
     "Child's Race","Caregiver Education","Sports 
Involvement","Epilepsy 
Status", "Percent FPL")] <- c("Bully-Victim","Family Resilience",                                                                                  
"TBI","Child's Sex","Child's Age",                                                                               
"Child's Race","Caregiver Education","Sports Involvement","Epilepsy 
 Status", "Percent FPL")

     heatmap.2(acenation[,-1], cellnote = acenation[,-1], notecol 
     = "black", key.xlab = "r value",
      trace = "none",
      par(cex.main=0.8),
      dendrogram = "column", density.info = "none", cexCol =1.3, 
     cexRow = 1.3,
      Rowv = NA,
      margins = c(15,15),
      labRow = labvec,
      main = "Correlation Matrix Between ACE Score, TBI and Covariates",
      scale= "none",col= brewer.pal(8, "Greens"))

在两个月前破解后,我几次使用此代码创建了多个加热地图。但是,它现在不起作用。任何帮助将不胜感激。非常感谢!

I am working with heat map in R and using heatmap2 function to create a correlation heat map. I created a heat map last night and it was just fine. I only missed to add one variable "Sports Involvement" and came back to add it and now it isn't working and showing me this error:

Error in .External.graphics(C_layout, num.rows, num.cols, mat, as.integer(num.figures), :
invalid graphics state
Error in par(op) : invalid value specified for graphical parameter "pin"

Here is my code:

labvec <- c(rep("ACE Score"))

labvec[c("Bully-Victim","Family Resilience",
     "TBI","Child's Sex","Child's Age",
     "Child's Race","Caregiver Education","Sports 
Involvement","Epilepsy 
Status", "Percent FPL")] <- c("Bully-Victim","Family Resilience",                                                                                  
"TBI","Child's Sex","Child's Age",                                                                               
"Child's Race","Caregiver Education","Sports Involvement","Epilepsy 
 Status", "Percent FPL")

     heatmap.2(acenation[,-1], cellnote = acenation[,-1], notecol 
     = "black", key.xlab = "r value",
      trace = "none",
      par(cex.main=0.8),
      dendrogram = "column", density.info = "none", cexCol =1.3, 
     cexRow = 1.3,
      Rowv = NA,
      margins = c(15,15),
      labRow = labvec,
      main = "Correlation Matrix Between ACE Score, TBI and Covariates",
      scale= "none",col= brewer.pal(8, "Greens"))

I created multiple heat maps with this code several times after I cracked this two months ago. However, it isn't working now. Any help will be appreciated. Thanks so much!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文