如何将 corrplot 与 method="number" 一起使用并删除前导零?

How to Use corrplot with method="number" and Drop Leading Zero?

如何使用包 corrplot 在 R 中绘制相关矩阵并在使用 'method="number"' 时去掉前导零?

例如,如果相关性为“0.78”,我希望它显示“.78”或“78”以保存 space。

此致, 斯科特

使用 corrplot 文档中的示例:

data(mtcars)
M <- cor(mtcars)

corrplot(round(100*M), method="number", col="black", cl.pos="n",is.corr=F)

这里的关键是我们实际上是在绘制相关矩阵,但是我们乘以 100 并四舍五入,所以我们必须设置 is.corr=F