[英]R - corrplot correlation matrix division
Here I make an example 12x12 correlation matrix: 在这里,我制作一个示例12x12相关矩阵:
df <- data.frame(x1=rnorm(20),x2=rnorm(20),x3=rnorm(20),x4=rnorm(20),x5=rnorm(20),x6=rnorm(20),x7=rnorm(20),x8=rnorm(20),x9=rnorm(20),x10=rnorm(20),x11=rnorm(20),x12=rnorm(20))
cormatx <- cor(df)
corrplot(cormatx, method="color")
I was wondering how this one output could be divided in to four separate 6x6 matrixes? 我想知道如何将这一输出分成四个单独的6x6矩阵? Here is an image of how the output should be divided. 这是如何划分输出的图像。 I hope this makes sense. 我希望这是有道理的。
Like this? 像这样?
par(mfrow = c(2,2))
corrplot(cormatx[1:6,1:6], method="color")
corrplot(cormatx[1:6,7:12], method="color")
corrplot(cormatx[7:12,1:6], method="color")
corrplot(cormatx[7:12,7:12], method="color")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.