[R] Correlograms: using boxes and different variables on rows and columns

dadrivr dadrivr at gmail.com
Fri May 25 15:38:41 CEST 2012


I'm trying to make correlograms using corrgram.  See below for a simple
example.

####
library(corrgram)

data(baseball)
vars1 <- c("Assists","Atbat","Errors","Hits","Homer","logSal")
vars2 <- c("Putouts","RBI","Runs","Walks","Years")

corrgram(baseball[,vars2],lower.panel=panel.shade, upper.panel=panel.pie)
####

I am having two problems:

1) I want to change the visual to "bars" (see Figure 1 on p. 3:
http://www.datavis.ca/papers/corrgram.pdf).  I tried changing the code for
the upper panel to include bars, but it doesn't appear correctly:

corrgram(baseball[,vars2],lower.panel=panel.shade, upper.panel=panel.bars)

2) I want to display one set of variables in the columns (vars1) and another
set of variables in the rows (vars2).  The reason I want to keep one set of
variables in the columns and another set of variables in the rows is because
I have many variables and am only interested in the correlations of vars1
with vars2 (and not of the intercorrelations of variables among vars1 or
among vars2).  Thus, the correlogram with separate variables in the rows and
columns would be more condensed and easier to examine visually.

Can I address these issues in corrgram, or is there another package that
will allow me to do that?  Thanks in advance.

--
View this message in context: http://r.789695.n4.nabble.com/Correlograms-using-boxes-and-different-variables-on-rows-and-columns-tp4631309.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list