Re: [R] Looping over groups

2008-08-20 Thread Dylan Beaudette
On Wednesday 20 August 2008, Josh B wrote: > > Works for me: > > x <- read.csv('christina.txt') > > > > x.list <- by(x, x$gen, function(d) { > > d.clean <- d[,-1] > > cov(d.clean, y= NULL, use= "complete.obs", method="pearson") > > } ) > > > >note that the output is a list, where each element corre

Re: [R] Looping over groups

2008-08-20 Thread Josh B
> Works for me: > x <- read.csv('christina.txt') > > x.list <- by(x, x$gen, function(d) { > d.clean <- d[,-1] > cov(d.clean, y= NULL, use= "complete.obs", method="pearson") > } ) > >note that the output is a list, where each element corresponds to one >level of 'gen'. if you need to write each elem

Re: [R] Looping over groups

2008-08-20 Thread Dylan Beaudette
ECTED]> > Cc: r-help@r-project.org > Sent: Wednesday, August 20, 2008 10:58:26 AM > Subject: Re: [R] Looping over groups > > On Wed, Aug 20, 2008 at 7:48 AM, Josh B <[EMAIL PROTECTED]> wrote: >> Hello, >> >> My R skills are somewhere between novice and intermedia

Re: [R] Looping over groups

2008-08-20 Thread Josh B
OTECTED]> To: Josh B <[EMAIL PROTECTED]> Cc: r-help@r-project.org Sent: Wednesday, August 20, 2008 10:58:26 AM Subject: Re: [R] Looping over groups On Wed, Aug 20, 2008 at 7:48 AM, Josh B <[EMAIL PROTECTED]> wrote: > Hello, > > My R skills are somewhere between novice and

Re: [R] Looping over groups

2008-08-20 Thread Peter Dalgaard
Dylan Beaudette wrote: > On Wed, Aug 20, 2008 at 7:48 AM, Josh B <[EMAIL PROTECTED]> wrote: > >> Hello, >> >> My R skills are somewhere between novice and intermediary, and I am hoping >> that some of you very helpful forum members, whom I've seen work your magic >> on other peoples' problems/

Re: [R] Looping over groups

2008-08-20 Thread Dylan Beaudette
On Wed, Aug 20, 2008 at 7:48 AM, Josh B <[EMAIL PROTECTED]> wrote: > Hello, > > My R skills are somewhere between novice and intermediary, and I am hoping > that some of you very helpful forum members, whom I've seen work your magic > on other peoples' problems/questions, can help me here. > > I

[R] Looping over groups

2008-08-20 Thread Josh B
Hello, My R skills are somewhere between novice and intermediary, and I am hoping that some of you very helpful forum members, whom I've seen work your magic on other peoples' problems/questions, can help me here. I have a matrix with the following format: (i) individual plants comprising many