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
library(arrow, warn.conflicts=FALSE)
library(dplyr, warn.conflicts=FALSE)
df<- tibble(a= rep(letters, 10), b=1:260, c=260:1)
df %>% slice_min(a, n=5, with_ties=TRUE)
#> # A tibble: 10 × 3#> a b c#> <chr> <int> <int>#> 1 a 1 260#> 2 a 27 234#> 3 a 53 208#> 4 a 79 182#> 5 a 105 156#> 6 a 131 130#> 7 a 157 104#> 8 a 183 78#> 9 a 209 52#> 10 a 235 26df %>% slice_min(a, n=5, with_ties=FALSE)
#> # A tibble: 5 × 3#> a b c#> <chr> <int> <int>#> 1 a 1 260#> 2 a 27 234#> 3 a 53 208#> 4 a 79 182#> 5 a 105 156df %>% slice_min(c, n=5)
#> # A tibble: 5 × 3#> a b c#> <chr> <int> <int>#> 1 z 260 1#> 2 y 259 2#> 3 x 258 3#> 4 w 257 4#> 5 v 256 5df %>% slice_min(c, prop=5/260)
#> # A tibble: 5 × 3#> a b c#> <chr> <int> <int>#> 1 z 260 1#> 2 y 259 2#> 3 x 258 3#> 4 w 257 4#> 5 v 256 5
Activity
asfimport commentedon Dec 17, 2021
Dewey Dunnington / @paleolimbot:
Some example usage maybe useful for a test:
asfimport commentedon Dec 17, 2021
Dewey Dunnington / @paleolimbot:
Without ties this isn't bad:
With ties isn't too bad either (just needs a join):
asfimport commentedon Oct 13, 2022
Neal Richardson / @nealrichardson:
Issue resolved by pull request 14361
#14361