Mike Love’s blog

R one liner: Correlation matrices

Posted in statistics, visualization by mikelove on March 31, 2011

I have seen many plots of correlation matricies using rainbow or heat colors and therefore not indicating the zero crossing. E.g.

Instead I would like to see this:

library(fields)
cormat = cor(X)
image.plot(cormat,zlim=c(-1,1),col=colorRampPalette(c("red","white","green"))(49))

About these ads

One Response

Subscribe to comments with RSS.

  1. regularhand said, on January 25, 2012 at 6:58 am

    totally agree.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: