[R] variables in a correlation matrix

juli g. pausas juli at ceam.es
Wed Mar 12 17:22:06 CET 2003


Hi,
Given a correlation matrix, how can I know which variables have certain 
correlation values?

aa <- matrix( rnorm(25, 1,1), 5,5)
colnames(aa) <- c("v1", "v2", "v3", "v4", "v5")
aacor <- cor(aa)

For instance, which variables are negatively correlated?    
aacor[aacor<0]  # provide the r values, but how I get the variables?

Any suggestion?
Thanks in advance

Juli



More information about the R-help mailing list