In dplyr functions, the first argument are mostly .data to prevent possible conflicts. But in tidyr, most functions use data as the first argument. And it creates an issue that when setting data as column name.
For example:
Since data is already used as the first argument of pack() function, when using "data" as a column, it will throw an error message.
df <- tibble(x1 = 1:3, x2 = 4:6, x3 = 7:9, y = 1:3)
df %>% pack(data = c(x1, x2, x3), y = y)
throws an error message:
Error: All elements of `...` must be named
The same applies to at least pack, unpack, chop and unchop
In
dplyrfunctions, the first argument are mostly.datato prevent possible conflicts. But intidyr, most functions usedataas the first argument. And it creates an issue that when settingdataas column name.For example:
Since
datais already used as the first argument ofpack()function, when using "data" as a column, it will throw an error message.throws an error message:
The same applies to at least
pack,unpack,chopandunchop