Corrplot:不打印每个文本标签
我使用的是他们的小插曲中的例子,但实际上,我的相关矩阵要大得多,因此文本标签在绘图上不清晰。我的愿望不是在相关图上打印每个文本标签Corrplot:不打印每个文本标签,r,r-corrplot,R,R Corrplot,我使用的是他们的小插曲中的例子,但实际上,我的相关矩阵要大得多,因此文本标签在绘图上不清晰。我的愿望不是在相关图上打印每个文本标签 M <- cor(mtcars) corrplot(M, diag = FALSE, method = "ellipse", type = "upper", tl.col = "black") 实际上,我正在处理的相关图是这样的 set.seed(234) A <- matrix(rnorm(1e+05), ncol = 100, dimnames
M <- cor(mtcars)
corrplot(M, diag = FALSE, method = "ellipse", type = "upper", tl.col = "black")
实际上,我正在处理的相关图是这样的
set.seed(234)
A <- matrix(rnorm(1e+05), ncol = 100, dimnames = list(NULL, paste0("VeryLongName", 1:100)))
corrplot(cor(A), diag = FALSE, method = "ellipse", type = "upper")
set.seed(234)
A可能在组中包含空字符串
require(corrplot)
#Reorder data collected in mtcars in this way:
mtcars2 <- mtcars[ , c("carb", "wt", "hp", "cyl", "disp",
"qsec", "vs",
"mpg", "drat", "am", "gear")
]
#Let's say I have the following groups corresponding to these variables
groups <- c("","Engine",rep("", 3), "Speed","", "Fuel",rep("", 3) )
rows <- c("Engine","",rep("", 3), "Speed","", "Fuel",rep("", 3) )
R <- cor(mtcars2)
colnames(R) <- groups
rownames(R) <- rows
corrplot(R, diag = FALSE, method = "ellipse", type = "upper", tl.col = "black")
require(corrplot)
#以这种方式对mtcars中收集的数据进行重新排序:
mtcars2
set.seed(234)
A <- matrix(rnorm(1e+05), ncol = 100, dimnames = list(NULL, paste0("VeryLongName", 1:100)))
corrplot(cor(A), diag = FALSE, method = "ellipse", type = "upper")
require(corrplot)
#Reorder data collected in mtcars in this way:
mtcars2 <- mtcars[ , c("carb", "wt", "hp", "cyl", "disp",
"qsec", "vs",
"mpg", "drat", "am", "gear")
]
#Let's say I have the following groups corresponding to these variables
groups <- c("","Engine",rep("", 3), "Speed","", "Fuel",rep("", 3) )
rows <- c("Engine","",rep("", 3), "Speed","", "Fuel",rep("", 3) )
R <- cor(mtcars2)
colnames(R) <- groups
rownames(R) <- rows
corrplot(R, diag = FALSE, method = "ellipse", type = "upper", tl.col = "black")