繁体   English   中英

如何在 R-Studio 的 plot 窗格中显示树状图

[英]How can I show a dendrogram in the plot pane in R-Studio

我正在使用以下代码生成树状图:

#Hierarchial Clustering
hc<-hclust(distance_matrix,method='average')
plot(hc, cex=0.35, hang=-1)

在此处输入图像描述

plot 显示在 RMD window 中,但不在 plot 窗格中。 如何让它显示在 plot 窗格中?

我已经尝试更新 RStudio。

我试过运行:

dev.off()

options(device = "RStudioGD")

这些解决方案都没有奏效。 如何在 plot 窗格中显示树状图?

通常,您可以将块输出发送到内联或控制台中显示。 因此,您只需在文档顶部添加:

editor_options: 
  chunk_output_type: console

然后你的图(包括你的树状图)应该出现在查看器窗格中。

You can also toggle this option through the GUI in Rstudio by selecting the arrow next to the 'gear' icon at the top of the editor window and select 'Chunk Output in Console'. 在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM