Skip to content

Update pivot_wider() documentation #794

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

Merged
merged 3 commits into from
Mar 29, 2022
Merged

Conversation

mgirlich
Copy link
Collaborator

Users are confused that pivot_wider() is not lazy (e.g. #598, #703). Collecting is only necessary to generate the spec.
As long as tidyr::pivot_wider_spec() is not made a generic I see two ways of handling this:

  • just update the documentation (like it is done here) or
  • export dbplyr_pivot_wider_spec() (which is lazy) so people can generate the spec locally.

@hadley Do you have any preference?

@hadley
Copy link
Member

hadley commented Mar 17, 2022

I think just updating the documentation is fine. Maybe it's worth mentioning why? (i.e. "pivot_wider() isn't lazy, and in fact can't be lazy, because we need to look at the data to figure out what the new column names will be). I guess we could also provide an additional argument that would let you supply the new names?

@mgirlich
Copy link
Collaborator Author

To me adding an argument for the names does not make much sense. This feels like a super simplified specification and this would require additional testing and implementation. So, I just add some more information to the documentation.

Co-authored-by: Hadley Wickham <[email protected]>
@mgirlich mgirlich merged commit 13bbb63 into main Mar 29, 2022
@mgirlich mgirlich deleted the pivot-wider-not-lazy-documentation branch April 6, 2022 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants