Re: [R] adding row ID numbers by group

2010-03-02 Thread Alexander Schwall
- Original Message > > From: Alexander Schwall > > To: r-help@r-project.org > > Sent: Tue, March 2, 2010 9:53:19 AM > > Subject: [R] adding row ID numbers by group > > > > Hello R community, > > I am hoping for some help with the following > &g

Re: [R] adding row ID numbers by group

2010-03-02 Thread Felipe Carrillo
life Service California, USA - Original Message > From: Alexander Schwall > To: r-help@r-project.org > Sent: Tue, March 2, 2010 9:53:19 AM > Subject: [R] adding row ID numbers by group > > Hello R community, I am hoping for some help with the following > prob

Re: [R] adding row ID numbers by group

2010-03-02 Thread Henrique Dallazuanna
Try this: data$ID <- with(data, ave(group, group, FUN = seq)) On Tue, Mar 2, 2010 at 2:53 PM, Alexander Schwall wrote: > Hello R community, > > I am hoping for some help with the following problem. > > I have a data frame containing various groups. These groups are identified > by a grouping va

[R] adding row ID numbers by group

2010-03-02 Thread Alexander Schwall
Hello R community, I am hoping for some help with the following problem. I have a data frame containing various groups. These groups are identified by a grouping variable. I would like to add a sequential ID number to each group to later sort these individuals within each group by this ID number.