I've been following along with the Tidyr official documentation, trying to freshen up on it because I haven't used it in awhile.
One of the examples involving the billboard
dataset produces the following error:
library(tidyr)
billboard %>%
pivot_longer(
cols = starts_with("wk"),
names_to = "week",
names_prefix = "wk",
names_transform = list(week = as.integer),
values_to = "rank",
values_drop_na = TRUE,
)
Error in pivot_longer(., cols = starts_with("wk"), names_to = "week", : unused argument (names_transform = list(week = as.integer))
I'm a bit confused as to what's going on because as I mentioned earlier, this is in the official tidyr
package documentation.