Posts

Showing posts with the label correlation

How to keep order of the correlation plot labels as same in the datafile?

Image
How to keep order of the correlation plot labels as same in the datafile? In Correlation plot, How can I keep the labels in the same order as in datafile, without rearranging? This is the scripts I have been using; 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" ) sample data 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, 2.07, 1.29, 0.71, 0.92, 0.57, 1.9, 0.84, 0.4, 2.72, 1.08, 0.96, 1.75, 0.24, 0.76, 0.99, 2.35, 2.06, 1.24 ), Cytosol_3 = c(1...