Re: [R] as.data.frame.table() to convert by() output to a data frame

2009-11-25 Thread David Winsemius
On Nov 26, 2009, at 12:17 AM, David Winsemius wrote: On Nov 25, 2009, at 9:54 PM, Michael Ash wrote: 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 .

Re: [R] as.data.frame.table() to convert by() output to a data frame

2009-11-25 Thread David Winsemius
On Nov 25, 2009, at 9:54 PM, Michael Ash wrote: 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$A

Re: [R] as.data.frame.table() to convert by() output to a data frame

2009-11-25 Thread Michael Ash
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,

Re: [R] as.data.frame.table() to convert by() output to a data frame

2009-11-25 Thread David Winsemius
On Nov 25, 2009, at 4:11 PM, Michael Ash wrote: Dear all, This seems to be working, but I'd like to make sure that I'm not doing anything wrong. I am using by() to construct a complicated summary statistic by several factors in my data (specifically, the 90-50 income ratio by city and race).

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

2009-11-25 Thread Michael Ash
Dear all, This seems to be working, but I'd like to make sure that I'm not doing anything wrong. I am using by() to construct a complicated summary statistic by several factors in my data (specifically, the 90-50 income ratio by city and race). cityrace.by <- by(microdata, list(microdata$city,mi