-
Notifications
You must be signed in to change notification settings - Fork 417
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
Documentation for pivot_longer()
- ptypes
vs transform
#1364
Comments
I think we do a pretty good job of documenting them already The
The
And then in the examples section we point you to the pivot vignette, and this section has an example that uses So the The |
That error message could be improved though. It is supposed to tell you the column it can't convert to character. library(tidyr)
df <- tibble(x = 1)
# Should say:
# Can't convert `x` <double> to <character>.
pivot_longer(
df,
cols = x,
names_to = "name",
values_to = "value",
values_ptypes = list(value = character())
)
#> Error:
#> ! Can't convert <double> to <character>. Created on 2022-06-02 by the reprex package (v2.0.1) |
I love the new(ish)
pivot_*()
functions. Although I use them a lot, I don't understand when to useptypes
and when to usetransform
. Could the documentation include examples for each? Data class mismatches are the most common error I face and I found suggestions to use each of these when looking on stackoverflowThe text was updated successfully, but these errors were encountered: