在相关图中,如何在不重新排列的情况下保持标签与数据文件中的顺序相同?
这是我一直在使用的脚本;
library(corrplot)
library(RColorBrewer)
library(Hmisc)
CORR <- df
M <- cor(CORE)
pM <- rcorr(M)
corrplot(pM$r,
type="upper",
order="hclust",
tl.cex = 0.5,
col=colorRampPalette(c("blue4", "white", "firebrick1"))(100),
p.mat = pM$P,
sig.level = 0.05,
insig = "blank"
)
Run Code Online (Sandbox Code Playgroud)
样本数据
df <- structure(list(Cytosol_1 = c(2.8, 0.31, 1.21, 1.84, 0.93, 2.71, 2.03, 0.93, 0.89, 0.4, 0.32, 1.8, 1.16, 0.39, 1.16, 0.76, 1.17, 0.95, 0.58, 2.68, 0.88, 0.59, 1.49, 0.48, 0.51, 1.04, 0.89, 3.48, 1.47), Cytosol_2 = c(1.61, 0.22, 1.42, 1.97, 0.88, 1.46, 1.43, 0.74, 0.72, 0.43, 0.51, …Run Code Online (Sandbox Code Playgroud)