Deprecate dataframe-based mapping functions #226
Merged
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.
Deprecation of rows-based functions now that we have the new mapping functions in dplyr and the nest() / mutate() / map() idiom.
One use case that does not have any equivalent in dplyr is when the output is within the range
c(1, nrow(df))
. For example:This can be worked around, for example here we'd do
However a new dplyr family of verbs for variable-length output may be useful. It could be called
condense()
.summarise()
it would discard all input columns except for the grouping variables. This allows the output to have a different number of rows than the input.summarise()
, it would not require length 1 results and would only check for equal length within group. Grouping columns would be recycled to these lengths.Ungrouped data frame: check squared constraint
This gives us immediately:
For a grouped data frame, we'd check the square constrain within groups:
Relevant discussion: tidyverse/dplyr#154