Hi all, i have a little problem, and i think it is really simple to solve, but i dont know exactly how to. here is the "challange": i have a data.frame with n colum, i have to group 2 of them and calculate the mean value of the 3. one. so far so good, that was easy - i used aggregate function to do this: group<-aggregate(x[,1],list(x[,2],x[,3]),mean) and now i have to copy the calculated mean value to every row of the date.frame (in a new column in the dataframe), ofcourse by copying should be the value adequate to the group
it will be great if someone can help me thanx in advance! -- View this message in context: http://r.789695.n4.nabble.com/group-by-in-data-frame-tp3324240p3324240.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.