Re: [R] extracting values from correlation matrix

2009-11-16 Thread jim holtman
Assuming that your data is in a dataframe 'cordata' , then following should work: cordata$cor2_value <- sapply(1:nrow(cordata), function(.row){ cor2[cordata$rowname[.row], cordata$colname[.row]] } On Mon, Nov 16, 2009 at 11:44 AM, Lee William wrote: > Hi! All, > > I have 2 correlation matric

[R] extracting values from correlation matrix

2009-11-16 Thread Lee William
Hi! All, I have 2 correlation matrices of 4000x4000 both with same row names and column names say cor1 and cor2. I have extracted some information from 1st matrix cor1 which is something like this: rowname colname cor1_value a b0.8 b a0.8 c