nathaneastwood / poorman

A poor man's dependency free grammar of data manipulation
https://nathaneastwood.github.io/poorman/
Other
339 stars 15 forks source link

`slice()` does not give duplicate rows #5

Closed nathaneastwood closed 4 years ago

nathaneastwood commented 4 years ago
slice(mtcars, 2, 3, 3, 3)                                                                                                                            
#                mpg cyl disp  hp drat    wt  qsec vs am gear carb
# Mazda RX4 Wag 21.0   6  160 110 3.90 2.875 17.02  0  1    4    4
# Datsun 710    22.8   4  108  93 3.85 2.320 18.61  1  1    4    1

dplyr::slice(mtcars, 2, 3, 3, 3)                                                                                                                     
#    mpg cyl disp  hp drat    wt  qsec vs am gear carb
# 1 21.0   6  160 110 3.90 2.875 17.02  0  1    4    4
# 2 22.8   4  108  93 3.85 2.320 18.61  1  1    4    1
# 3 22.8   4  108  93 3.85 2.320 18.61  1  1    4    1
# 4 22.8   4  108  93 3.85 2.320 18.61  1  1    4    1