r - Why is dcast not working in reshape2? -
this paper published reshape package (wickham 2007) gave example:
library(reshape2) ffm <- melt(french_fries, id = 1:4, na.rm = true)  dcast(ffm, variable ~ ., c(min, max)) similarly, doesn't work in reshape2 appears work in wickham 2007
dcast(ffm, variable ~ ., summary) however cast function giving error. how can function work?
the paper reshape package, not reshape2 package. have not reproduced example written. should be:
library("reshape") # not explicit in paper, implied since reshape pacakge ffm <- melt(french_fries, id = 1:4, na.rm = true) cast(ffm, treatment ~ rep, c(min, max)) note function call cast, not dcast. change 1 of major changes between 2 packages. dropping of multiple aggregation @ same time reshaping considered better handled plyr package. if use reshape package (which still available cran), examples work.
Comments
Post a Comment