Re: [R] means of a column within groups of a data frame

2008-12-11 Thread Jim Lemon
John Sorkin wrote: R 2.8.0 windows XP I would like to divide the rows of data frame into five groups and then get the mean of one column within the five groups. I have accomplished this using the code below, but I hope there is an easier way, i.e. some function that I can call # create five

Re: [R] means of a column within groups of a data frame

2008-12-10 Thread Daniel Malter
discussurus - -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von John Sorkin Gesendet: Wednesday, December 10, 2008 11:09 PM An: r-help@r-project.org Betreff: [R] means of a column within groups of a data frame R 2.8.0 windows XP

[R] means of a column within groups of a data frame

2008-12-10 Thread John Sorkin
R 2.8.0 windows XP I would like to divide the rows of data frame into five groups and then get the mean of one column within the five groups. I have accomplished this using the code below, but I hope there is an easier way, i.e. some function that I can call # create five groups. cut(data$BMI,