r - Add significant correlations to corrplot graph in R
问题描述
For my data I made a correlation plot. I want to visualize the correlations with the color method. Additionaly I would like to add the correlation coefficient, however, I only want to visualize them for the significant correlations, in all other cases I would like to show a cross.
This is what I have done:
GM_young <- replicate(6, rnorm(11))
colnames(GM_young2) <- c('PA_rest','FL-rest','MW_rest','PA_con','FL_con', 'MW_con')
corrGM_young<-cor(GM_young) # gives you a matrix with correlations
p.mat <- cor.mtest(GM_young) # matrix of the p-value of the correlation
# make corrplot
corrplot(corrGM_young, method = "color", type="lower",order = "hclust", p.mat = p.mat, sig.level = 0.01, diag=FALSE , tl.col="black",tl.cex = 0.8, cl.cex = 0.8,cl.ratio=0.3,tl.srt = 45, title="Gastrocnemius Young", mar=c(0,0,2,0), addCoef.col = TRUE)
However, now I get the coefficients for all the correlations. I only want to visualize the 0.74. The other boxes I want to visualize using the colors and the cross as they are not significant.
Can someone help me with this? Thank you
解决方案
推荐阅读
- r - R拟合函数仅返回起始编号
- ms-access - 访问 - 创建查询以匹配多个条件
- javascript - 如何在关联查询中指定外键
- jar - 我在 InteliJ 中构建我的程序的 .jar,但我使用 JTatto LookAndFeel 添加了外部 .jar,并且该应用程序无法在桌面上运行。如何修复它?
- dymola - 如何在 Dymola 中自动创建转换脚本
- c - 如何使用 C 语言中的指针在字符串数组中查找相同字符的基地址?
- r - 如何在R中搜索带括号的字符串
- .net - 如何将需求率添加到 Or-Tools vrp
- azure-devops - 如何为基于 YAML 的管道创建管道变量?
- python - 从 Excel 文件中删除所有空行而不覆盖文件