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 returns all rows, but it's not tested anywhere. I think it should return an empty data frame instead, and slice(df, i1, i2) should be the same as slice(df, c(i1, i2)).
I think the motivation was for filter(x) and slice(x) to give identical results, but maybe that's wrong because an empty logical should be treated as selecting all rows, whereas an empty integer should be treated as selecting no row.
Equally, filter() ANDs together the inputs, and here you're proposing (effectively) that slice OR's together the inputs.
I have now found the test. It seems that slice() intentionally accepts either 0 or one args, negative values are treated as exclusions. The current behavior actually makes some sense, I see no reason to change it.
We could still consider supporting multiple arguments to slice(), but only after #2311.
Currently returns all rows, but it's not tested anywhere. I think it should return an empty data frame instead, and slice(df, i1, i2) should be the same as slice(df, c(i1, i2)).
@hadley: Thoughts?
The text was updated successfully, but these errors were encountered: