I have searched google and stack overflow for an answer to my question in R but can't find a suitable one.
I have a matrix, which I import into R, I then use corrplot to plot. My question is that I have three correlation groupings:
1: 0-<0.5
2: >0.5-0.7
3: >0.7
I want one colour for each grouping, so red for group 1, blue for group 2, and green for group 3
Is there a way to do that?
here is some dummy data:
library(corrplot)
data(mtcars)
M <- cor(mtcars)
set.seed(0)
corrplot(M,type='upper',method = "square",addCoef.col = "white")
Many thanks in advance!
question from:
https://stackoverflow.com/questions/65937190/create-colour-range-with-corrplot-in-r 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…