markfairbanks / tidytable

Tidy interface to 'data.table'
https://markfairbanks.github.io/tidytable/
Other
450 stars 32 forks source link

`lag()` and `lead()` should preserve names #619

Closed markfairbanks closed 2 years ago

markfairbanks commented 2 years ago
vec <- c("a" = 1, "b" = 2, "c" = 3)

dplyr::lag(vec)
#>     a  b 
#> NA  1  2

tidytable::lag(vec)
#> [1] NA  1  2

Edit: On second thought the performance hit probably isn't worth it. If someone requests it we can implement.