Why is dcast not working in reshape2?
为 reshape package (Wickham 2007) 发表的这篇论文给出了这个例子:
1 2 3 4 | library(reshape2) ffm <- melt(french_fries, id = 1:4, na.rm = TRUE) dcast(ffm, variable ~ ., c(min, max)) |
同样,这在 reshape2 中不起作用,但似乎在 Wickham 2007 中起作用
1 | dcast(ffm, variable ~ ., summary) |
但是 cast 函数给出了一个错误。如何让功能正常工作?
本文针对的是
1 2 3 | 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)) |
注意函数调用是