说,我有以下数据:
set.seed(10)
dat <- data_frame(
SKU = rep(c("sku1", "sku2", "sku3"), each=4),
invoicedate = rep(c("12/01/2019", "12/02/2019", "12/03/2019", "12/04/2019"), 3),
cantidad = round(rnorm(12, mean = 80, sd=4), 0)
)
dat
如何获得以下格式?
invoicedate sku1 sku2 sku3
12/01/2019 80 81 73
12/02/2019 79 82 79
12/03/2019 75 75 84
12/04/2019 78 79 83
谢谢!