?tapply Bendix Carstensen
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of thomas hills > Sent: Saturday, February 26, 2005 6:17 PM > To: r-help@stat.math.ethz.ch > Subject: [R] averaging within columns > > > I have a dataframe with names in the first column and wait times > between decisions in the second column. Since individuals make > multiple decisions, I want the average for each individual. For > example, the data might look like this > > name wtime > jo 1 > jo 2 > jo 1 > jo 3 > tim 3 > tim 2 > tim 2 > ro 1 > ro 2 > etc. > > I'm hoping there is something like > > mean(dataname$wtime[name]) > > which will just create a column with length equal to the number of > different names (levels) and an average wtime for each. So > far though, > I haven't had much luck figuring that one out. > > Thanks. > Thomas > > ______________________________________________ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read > the posting guide! http://www.R-project.org/posting-guide.html > ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html