Say we use the mtcars data from corrplot. How can we obtain a triangular matrix plot using pheatmap?
library(corrplot)
library(pheatmap)
M <- cor(mtcars)
pheatmap(M)
This is a simple way to get a triangular matrix plot from pheatmap
.
M[lower.tri(M)] <- NA
pheatmap(M, cluster_rows=F, cluster_cols=F, na_col="white")