Heatmap or plot for a correlation matrix

lattice, r

Solution

@Lucas provides good advice here as corrplot is quite useful for visualizing correlation matrices. However, it doesn't address the original issue of plotting a large correlation matrix. In fact, corrplot will also fail when trying to visualize this large of a correlation matrix. For a simple solution, you might want to consider reducing the number of variables. That is, I would suggest looking at the correlation between a subset of variables that you know are important for your problem. Trying to understand the correlation structure of that many variables will be a difficult task (even if you can visualize it)!

Problem

I tried to make a plot out of the correlation matrix and having three colours to represent the correlation coefficients using the library lattice. ``` library(lattice) levelplot(cor) ``` I obtain the following plot: The plot is only for a subset of the data I had. When I use the whole dataset( 400X400) then it becomes unclear and the colouring is not shown properly and is shown as dots. Is it possible to obtain the same in tile form for a large matrix? I tried using the pheatmap function but I do not want my values to be clustered and just want a representaion of high and low values clearly in a tile form.

Original source

Related problems