How to use corrplot with simple matrices

你说的曾经没有我的故事 提交于 2020-07-05 07:56:10

问题


I have a simple 8 by 8 matrix

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

How should I transform it to plot it with 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]?


回答1:


Just indicate that it is not a correlation matrix:

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

enter image description here



来源:https://stackoverflow.com/questions/26202670/how-to-use-corrplot-with-simple-matrices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!