Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slice doesn't drop excess rows #10

Closed
hadley opened this issue Mar 8, 2016 · 1 comment · Fixed by #275
Closed

Slice doesn't drop excess rows #10

hadley opened this issue Mar 8, 2016 · 1 comment · Fixed by #275
Labels
bug an unexpected problem or unintended behavior dplyr-compat 💞 dplyr compatibility issues

Comments

@hadley
Copy link
Member

hadley commented Mar 8, 2016

Moved from tidyverse/dplyr#1446, by @franknarf1

library(dplyr, warn.conflicts = FALSE)
library(dtplyr)

df <- data.frame(x = c("a","a","b"), y = c(2,3,4))

tbl_df(df) %>% slice(3:4)
#> # A tibble: 1 x 2
#>   x         y
#>   <fct> <dbl>
#> 1 b         4
tbl_dt(df) %>% slice(3:4)
#> Source: local data table [2 x 2]
#> 
#> # A tibble: 2 x 2
#>   x         y
#>   <fct> <dbl>
#> 1 b         4
#> 2 <NA>     NA

Created on 2019-05-25 by the reprex package (v0.2.1.9000)

@hadley hadley added bug an unexpected problem or unintended behavior dplyr-compat 💞 dplyr compatibility issues labels Jun 13, 2019
@hadley
Copy link
Member Author

hadley commented Jun 26, 2019

Includes handling NA in indices

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior dplyr-compat 💞 dplyr compatibility issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant