简体   繁体   English

如何使用简单矩阵的corrplot

[英]How to use corrplot with simple matrices

I have a simple 8 by 8 matrix 我有一个简单的8乘8矩阵

M <- matrix(rnorm(64), nrow=8, ncol=8) 

How should I transform it to plot it with library(corrplot) ? 我应该如何将其转换为使用library(corrplot)绘制它? Without transformation the error is: 没有转换,错误是:

corrplot.mixed(M)

Error in corrplot(corr, type = "upper", method = upper, diag = TRUE, tl.pos = tl.pos, : The matrix is not in [-1, 1]! which I guess would assume that the matrix should be [-1, 1]? corrplot中的错误(corr,type =“upper”,method = upper,diag = TRUE,tl.pos = tl.pos,:矩阵不在[-1,1]中!我猜这会假设矩阵应该是[-1,1]?

Just indicate that it is not a correlation matrix: 只是表明它不是一个相关矩阵:

library(corrplot)
corrplot(M, is.corr = FALSE, method = "square")

在此输入图像描述

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

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