The paper is for the reshape
package, not the reshape2
package. You have also not reproduced the example as it was written. It should be:
library("reshape") # not explicit in the paper, but implied since it is for the reshape pacakge
ffm <- melt(french_fries, id = 1:4, na.rm = TRUE)
cast(ffm, treatment ~ rep, c(min, max))
Note that the function call is cast
, not dcast
. That change was one of the major changes between the two packages. Another was the dropping of multiple aggregation at the same time as reshaping as this was considered to be better handled by the plyr
package. If you use the reshape
package (which is still available from CRAN), the examples work.