0
我想下面寫的tidyr::spread
呼叫的reshape2::dcast
如何使用dcast進行傳播?
stocks <- data.frame(
time = as.Date('2009-01-01') + 0:9,
X = rnorm(10, 0, 1),
Y = rnorm(10, 0, 2),
Z = rnorm(10, 0, 4)
)
stocksm <- stocks %>% gather(stock, price, -time)
stocksm %>% spread(time, price)
我有麻煩搞清楚什麼傳遞給fun.aggregate