Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(corrplot)
- gendat = read.csv("NEW_RBP/TF_MYELOID_DISEASE.txt",row.names = 1,sep = "t")
- dim(gendat)
- head(gendat)
- gen <- gendat
- head(gen)
- M<- cor(gen, use="complete.obs", method="spearman")
- corr <- round(cor(M),1)
- names(gen)
- dim(gen)
- mycolors <- rep(NA,23)
- names(mycolors) <- names(gen)
- mycolors[1:4] <- 'black' # mpg, cyl, disp, hp
- mycolors[5:15] <- 'red' # drat, wt, qsec, vs, am
- mycolors[16:23] <- 'blue'
- mycolors[13:16] <- 'darkgreen'
- ord <- corrMatOrder(corr, order="hclust")
- newcolours <- mycolors[ord]
- newcolours
- corrplot(M, tl.col = newcolours, method = "color",is.corr = FALSE,
- tl.srt = 45,diag = TRUE
- ,order = "hclust",hclust.method = c("complete"),addrect = 5,tl.cex = 3,number.cex=1.5)
- corrplot(corr, tl.col = newcolours, method = "color",is.corr = TRUE,
- tl.srt = 45,diag = TRUE
- ,order = "hclust",hclust.method = c("complete"),addrect = 3,tl.cex = 3,number.cex=1.5)
Add Comment
Please, Sign In to add comment