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

Add more error checking to rename_with() #6574

Merged

Conversation

DavisVaughan
Copy link
Member

Closes #6561

@DavisVaughan DavisVaughan requested a review from hadley November 29, 2022 17:36
R/rename.R Outdated
"{.arg .fn} must return a character vector, not {.obj_type_friendly {new}}."
)
}
if (vec_size(new) != vec_size(sel)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't tell if it would be clearer to use length() here, since we know that new and old are both character vectors.

@DavisVaughan DavisVaughan force-pushed the fix/rename-with-character-results branch from d9287d1 to 77de7b5 Compare November 29, 2022 18:57
@DavisVaughan DavisVaughan merged commit e9f5b56 into tidyverse:main Nov 29, 2022
@DavisVaughan DavisVaughan deleted the fix/rename-with-character-results branch November 29, 2022 18:57
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.

rename_with() doesn't handle factors well
2 participants