Skip to content

Improve error message for pivot_wider() #1598

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

hrryt
Copy link

@hrryt hrryt commented May 24, 2025

Fixes #1593.

Supplies an additional message to vctrs_error_subscript_oob if the user does not supply names_from or values_from to pivot_wider() or build_wider_spec().

pivot_wider(us_rent_income)

Before:

Error in `pivot_wider()`:
! Can't select columns that don't exist.
✖ Column `name` doesn't exist.
Run `rlang::last_trace()` to see where the error occurred.

After:

Error in `pivot_wider()`:
ℹ Column `name` is the default for the `names_from` argument.
Caused by error in `pivot_wider()`:
! Can't select columns that don't exist.
✖ Column `name` doesn't exist.
Run `rlang::last_trace()` to see where the error occurred.

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.

Error Message: pivot_wider() Help those who are a little undercaffeinated, slow on the uptake...
1 participant