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 pivot_longer() and pivot_wider() instead of gather() and spread() #570
Comments
I've had a look at doing this in a branch of a fork of the repo (link valid at time of posting). Looks like outputs from the pivot functions differ from For example, consider the
If the same code is re-run with
So |
Hmmm...interesting. Any reason why the ordering in the output is different between |
Related: datacarpentry/r-socialsci#104 |
Lesson: Dataframe Manipulation with tidyr.
Suggestion: replace
spread()
andgather()
withpivot_longer()
andpivot_wider()
.Reason: these new, more intuitive functions are intended to be the de facto approach to making data 'longer' and 'wider' as of {tidyr} version 1.0.0 (though
gather()
andspread()
continue to work).The text was updated successfully, but these errors were encountered: