Unlike mutate()
, transmute()
keeps only the variables that you create
transmute(.df, ..., .by = NULL)
df <- data.table(
a = 1:3,
b = 4:6,
c = c("a", "a", "b")
)
df %>%
transmute(double_a = a * 2)
#> # A tidytable: 3 × 1
#> double_a
#> <dbl>
#> 1 2
#> 2 4
#> 3 6