[R] Group several variables and apply a function to the group

2011-12-04 Thread Aurélien PHILIPPOT
Dear R-experts, I am struggling with the following problem, and I am looking for advice from more experienced R-users: I have a data frame with 2 identifying variables (comn and mi), and an output variable (x). comn is a variable for a company and mi is a variable for a month. comn-c(abc, abc,

Re: [R] Group several variables and apply a function to the group

2011-12-04 Thread Felipe Carrillo
@r-project.org Sent: Sunday, December 4, 2011 12:32 PM Subject: [R] Group several variables and apply a function to the group Dear R-experts, I am struggling with the following problem, and I am looking for advice from more experienced R-users: I have a data frame with 2 identifying variables (comn

Re: [R] Group several variables and apply a function to the group

2011-12-04 Thread Aurélien PHILIPPOT
://www.fws.gov/redbluff/rbdd_jsmp.aspx *From:* Aurélien PHILIPPOT aurelien.philip...@gmail.com *To:* R-help@r-project.org *Sent:* Sunday, December 4, 2011 12:32 PM *Subject:* [R] Group several variables and apply a function to the group Dear R-experts, I am struggling with the following

Re: [R] Group several variables and apply a function to the group

2011-12-04 Thread Pete Brecknock
Aurélien PHILIPPOT wrote Dear R-experts, I am struggling with the following problem, and I am looking for advice from more experienced R-users: I have a data frame with 2 identifying variables (comn and mi), and an output variable (x). comn is a variable for a company and mi is a variable

Re: [R] Group several variables and apply a function to the group

2011-12-04 Thread John Kane
: Aurélien PHILIPPOT aurelien.philip...@gmail.com Subject: [R] Group several variables and apply a function to the group To: R-help@r-project.org Received: Sunday, December 4, 2011, 3:32 PM Dear R-experts, I am struggling with the following problem, and I am looking for advice from more

Re: [R] Group several variables and apply a function to the group

2011-12-04 Thread Bert Gunter
Using the reshape2 package library(reshape2) x1 - melt(df, id=c(comn, mi)) dcast(x1, comn + mi ~ variable, sd) --- On Sun, 12/4/11, Aurélien PHILIPPOT aurelien.philip...@gmail.com wrote: From: Aurélien PHILIPPOT aurelien.philip...@gmail.com Subject: [R] Group several variables