# NOT RUN {
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)
) %>%
longer_dt(time) -> longer_stocks
longer_stocks
longer_stocks %>%
wider_dt("time","variable","value")
longer_stocks %>%
mutate_dt(one = 1) %>%
wider_dt("time","variable","one")
# }
Run the code above in your browser using DataLab