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

Export vec_locate_sorted_groups() #1441

Closed

Conversation

DavisVaughan
Copy link
Member

@DavisVaughan DavisVaughan commented Aug 26, 2021

Looking at the prefix document, we've been thinking about using "locate" as the verb that generally deals with returning integer locations.

i.e. in theory all of these return an integer vector of locations

vec_locate_unique()
vec_locate_missing()
vec_locate_named()

While vec_locate_sorted_groups() doesn't return an integer vector, it is highly related to the idea of those other functions because the $loc column contains the locations of each unique key.

In the same line of thinking, I would rename vec_group_loc() to vec_locate_groups().

I can't think of any prefix that better differentiates between returning an integer vector of locations (like vec_locate_unique()) VS returning a df that contains a list column of integer locations (like vec_locate_groups()). I think since the ideas are so closely related, we can look past their difference in return value types in favor of having this nice "locate" prefix.

@DavisVaughan DavisVaughan changed the title Export vec_sorted_group_locs() Export vec_locate_sorted_groups() Aug 26, 2021
@DavisVaughan DavisVaughan requested a review from lionel- August 26, 2021 18:04
Copy link
Member

@lionel- lionel- left a comment

Choose a reason for hiding this comment

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

I can't think of any prefix that better differentiates between returning an integer vector of locations (like vec_locate_unique()) VS returning a df that contains a list column of integer locations (like vec_locate_groups()). I think since the ideas are so closely related, we can look past their difference in return value types in favor of having this nice "locate" prefix.

I can't think of anything better either. You're probably right that trying to differentiate rich results and direct results would only produce a complicated naming scheme.

DavisVaughan added a commit to DavisVaughan/dplyr that referenced this pull request Sep 16, 2021
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