Say, I have the following data:
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
How do I get to the following format?:
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
Thank you!