Heatmaply 在 R Viewer 或 Markdown 中未显示,但在按下 “在新窗口中显示” 时加载。

huangapple go评论68阅读模式
英文:

Heatmaply not showing in R Viewer or Markdown, but does load when pressing "show in new window"

问题

我有一个heatmaply图表,有近800个数据点。当我运行这个图表时,它不会在R Viewer中显示,除非我点击“在新窗口中显示”。然后它会在我的浏览器中正确显示。在渲染后,该图表也不会显示在我的Markdown文件中。

我已经尝试了一些参数,发现当我将“showticklabels”设置为FALSE时,图表似乎会加载。然而,当我将它设置为c(FALSE, TRUE)时,图表加载失败。这对我来说很奇怪,因为我将其设置为TRUE,以仅显示两个样本名称的标签,将其设置为FALSE,以显示800个miRNA的标签,理论上应该使其加载更快。我已经多次检查过这一点,我确信它们是正确的顺序,因为它在“显示新窗口”中正确加载。


Does load: HMly = heatmaply(MLH0_1HMmat, colors = mycolors, dendrogram = "column", xlab = "miRNAs", labRow = c("SW480", "HCT116 MLH1-2"), showticklabels = FALSE

希望能帮到您!

英文:

I have a heatmaply graph with almost 800 data points. When I run the plot, it will not show up in the R Viewer unless I click on "show in new window". Then it will display correctly in my browser. The plot also will not show in my markdown file after rendering with Knit.

I've been playing with the parameters, and found that the graph does seem to load when I set "showticklabels" to FALSE. However when I have it set to c(FALSE, TRUE), the graph fails to load. This is odd to me because I have it set to TRUE for showing only the labels for the two sample names, and FALSE for the 800 miRNAs, which in theory should make it load faster. I've checked this many times and I am certain they are in the right order because it loads correctly in "show new window".

Doesn't load:
HMly = heatmaply(MLH0_1HMmat, colors = mycolors, dendrogram = "column", xlab = "miRNAs", labRow = c("SW480", "HCT116 MLH1-2"), showticklabels = c(FALSE,TRUE))

Does load:
HMly = heatmaply(MLH0_1HMmat, colors = mycolors, dendrogram = "column", xlab = "miRNAs", labRow = c("SW480", "HCT116 MLH1-2"), showticklabels = FALSE

Any help would be greatly appreciated!

答案1

得分: 0

The problem seems to be solved by truncating the column labels to no more than 14 characters. In attempting to make a reproducible example, I found that the length of the names was the variable affecting whether the heatmaply plot would load or not. I hope this helps someone.

stringr::str_trunc(colNames, 14)

英文:

The problem seems to be solved by truncating the column labels to no more than 14 characters. In attempting to make a reproducible example, I found that the length of the names was the variable affecting whether the heatmaply plot would load or not. I hope this helps someone.

stringr::str_trunc(colNames, 14)

huangapple
  • 本文由 发表于 2023年5月11日 03:24:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/76221952.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定