Re: [R] calculating average for multiple subclasses in a data set

2009-03-27 Thread Jorge Ivan Velez
Dear Dan, Try this: with(dummy,tapply(as.numeric(len),as.factor(V1),summary)) See ?with, ?tapply and ?summary for more information. HTH, Jorge On Fri, Mar 27, 2009 at 10:15 PM, Dan Kortschak < dan.kortsc...@adelaide.edu.au> wrote: > Hello R users, > > I have a data set which is a set of len

[R] calculating average for multiple subclasses in a data set

2009-03-27 Thread Dan Kortschak
Hello R users, I have a data set which is a set of lengths and types of objects. I want to calculate the mean length for each type of object as opposed to the mean of all the objects in the set. This is in order to make a comparison between the lengths of each type of objects and the number of th