Re: [R] correlation between rows of data.frame

2008-08-02 Thread jim holtman
You can convert to a numeric matrix to make the operations faster: > > x=data.frame(id=rep(sample(1:10,size=1),2),a=sample(c(NA,rnorm(10,0,1)),size=2, + replace=T),b=sample(c(NA,rnorm(10,0,1)),size=2, + replace=T),c=sample(c(NA,rnorm(10,0,1)),size=2, replace=T)) > x$id=factor

Re: [R] correlation between rows of data.frame

2008-08-01 Thread Christos Hatzis
, dist) -Christos > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Eleni Rapsomaniki > Sent: Friday, August 01, 2008 2:45 PM > To: r-help@r-project.org > Subject: [R] correlation between rows of data.frame > > Dear R users, > &

[R] correlation between rows of data.frame

2008-08-01 Thread Eleni Rapsomaniki
Dear R users, I need to come up with an efficient method to compute the correlation (or at least, the euclidean distance if that's easier) between specific rows in a data frame (46,232 rows,29 columns). The pairs of rows between which I want to find the correlation share a common value in one