Export vec_locate_sorted_groups()
#1441
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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()
tovec_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 (likevec_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.