Skip to content
Prev 201691 / 398503 Next

as.data.frame.table() to convert by() output to a data frame

I remain confused by the difference between

library(MASS)
data(Cars93)

as.data.frame(tapply(Cars93$Price,list(Cars93$Origin,Cars93$AirBags,Cars93$Passengers),median))
as.data.frame.table(tapply(Cars93$Price,list(Cars93$Origin,Cars93$AirBags,Cars93$Passengers),median))


I clearly want the latter, but that's not clear from the documentation.


Best,
Michael
On Wed, Nov 25, 2009 at 5:55 PM, David Winsemius <dwinsemius at comcast.net> wrote: