reshape2: multiple results of aggregation function?
问题 From what I read, *cast operations in reshape2 lost their result_variable feature. Hadley hints at using plyr for this purpose (appending multiple result columns to the input data frame). How would I realize the documentation example ... aqm <- melt(airquality, id=c("month", "day"), na.rm=TRUE) cast(aqm, month ~ variable + result_variable, range) using reshape2 ( dcast ) and plyr ( ddply )? 回答1: This question has multiple answers, due to the flexibility of the 'reshape2' and 'plyr' packages.