You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the default behavior of top_n is to use the last variable when none is specified. Just wondering if it would perhaps make more sense to use the indices.
For example:
iris %.% group_by(Species) %.% top_n(2)
will use the last variable Species. Of course, within each group, all values for Species are equal, so this will give us the entire data.
So I'm wondering if iris %.% group_by(Species) %.% top_n(2) should express "the two first rows in each group"
The text was updated successfully, but these errors were encountered:
I think this probably should be the job for another function, since it's not quite the regular defintion of top_n(). I was thinking of building slice() out of integer_filter().
Currently the default behavior of
top_n
is to use the last variable when none is specified. Just wondering if it would perhaps make more sense to use the indices.For example:
will use the last variable
Species
. Of course, within each group, all values for Species are equal, so this will give us the entire data.So I'm wondering if
iris %.% group_by(Species) %.% top_n(2)
should express "the two first rows in each group"The text was updated successfully, but these errors were encountered: