# NOT RUN {
test_df <- data.table(
z = rep(c("a", "b", "c"), 2),
stuff = c(rep("x", 3), rep("y", 3)),
things = 1:6)
test_df %>%
pivot_wider.(names_from = stuff, values_from = things)
test_df %>%
pivot_wider.(names_from = stuff, values_from = things, id_cols = z)
# }
Run the code above in your browser using DataLab