Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use .data in pack() #759

Closed
yusuzech opened this issue Sep 23, 2019 · 5 comments
Closed

Use .data in pack() #759

yusuzech opened this issue Sep 23, 2019 · 5 comments
Labels
bug an unexpected problem or unintended behavior wip work in progress
Milestone

Comments

@yusuzech
Copy link

yusuzech commented Sep 23, 2019

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

@dpprdan

This comment has been minimized.

@hadley

This comment has been minimized.

@dpprdan

This comment has been minimized.

@hadley hadley added the bug an unexpected problem or unintended behavior label Nov 24, 2019
@hadley hadley changed the title Changing data to .data in tidyr functions Use .data in pack() Nov 24, 2019
@hadley
Copy link
Member

hadley commented Nov 24, 2019

I think this only applies to pack() and unnest(), because chop(), unchop(), and unpack() don't have ....

hadley added a commit that referenced this issue Nov 28, 2019
@hadley hadley added the wip work in progress label Nov 28, 2019
@hadley hadley added this to the v1.1.0 milestone Nov 28, 2019
@hadley
Copy link
Member

hadley commented Apr 24, 2020

And ... is deprecated in unnest(), so pack() is the only function that needs a fix.

@hadley hadley closed this as completed in 89b1975 Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior wip work in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants