rheatmapcorrelationr-corrplotggcorrplot

corrplot one column multiple groups single plot


I would like a corrplot, where I only have the first column. I got that solution from here: Corrplot with only one variable on x axis

library(corrplot) 
corrplot(cor(iris[,1:4])[1:4,1, drop=FALSE], cl.pos='n')

but I would like the first column to repeat WITHIN THE SAME PLOT by group: enter image description here

I am not married to using corrplot but need some similar solution. Thanks for any and all help.


Solution

  • Here is a hacky way to do it without an additional package:

    library(corrplot)
    Dat<-cor(iris[,1:4])[1:4,1, drop=FALSE]
    PlotDat<-cbind(Dat,Dat,Dat)
    corrplot(PlotDat, cl.pos='n')
    

    enter image description here