tidyverse / dtplyr

Data table backend for dplyr
https://dtplyr.tidyverse.org
Other
670 stars 57 forks source link

Add `.keep` to `mutate()` #340

Closed markfairbanks closed 2 years ago

markfairbanks commented 2 years ago
library(dplyr, warn.conflicts = FALSE)

df <- tibble(x = 1:3, y = 1:3)

df %>%
  mutate(double_x = x * 2, .keep = "used")
#> # A tibble: 3 × 2
#>       x double_x
#>   <int>    <dbl>
#> 1     1        2
#> 2     2        4
#> 3     3        6