Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide selected correlations for corrplot?

I am new to coding and R. I was trying to visualize a correlation matrix using corrplot, but don't want to show all the correlation values. I wish to hide/cancel a chunk of selected columns and rows correlation values, so only an inverted 'L' of values are shown.

As an example, see edited image of an example corrplot here:

enter image description here

like image 735
lyqgoh Avatar asked Apr 22 '14 07:04

lyqgoh


People also ask

How do you remove a correlation?

In some cases it is possible to consider two variable as one. If they are correlated, they are correlated. That is a simple fact. You can't "remove" a correlation.

What correlation does Corrplot use?

[ R , PValue ] = corrplot( Tbl ) plots the Pearson's correlation coefficients between all pairs of variables in the table or timetable Tbl , and also returns tables for the correlation matrix R and matrix of p-values PValue .

How do you visualize a correlation in R?

The easiest way to visualize a correlation matrix in R is to use the package corrplot. In our previous article we also provided a quick-start guide for visualizing a correlation matrix using ggplot2. Another solution is to use the function ggcorr() in ggally package.

What does a Corrplot show?

R package corrplot provides a visual exploratory tool on correlation matrix that supports automatic variable reordering to help detect hidden patterns among variables. corrplot is very easy to use and provides a rich array of plotting options in visualization method, graphic layout, color, legend, text labels, etc.


1 Answers

Set those entries you want blank in the plot to NA in the correlation matrix (or a copy of it) and then set the argument na.label=" " in the call to corrplot.

like image 130
GregRG Avatar answered Sep 30 '22 18:09

GregRG