You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is this possible while allowing transmute() to produce an output with a different number of rows?
This would also fix the fact that transmute() should have the same number of rows but currently doesn't. We just need a column reorder after the mutate.
mtcars %>%
lazy_dt() %>%
transmute(hp=1, mpg=2)
#> Source: local data table [1 x 2]#> Call: `_DT4`[, .(hp = 1, mpg = 2)]#> #> hp mpg#> <dbl> <dbl>#> 1 1 2#> #> # Use as.data.table()/as.data.frame()/as_tibble() to access resultsmtcars %>%
lazy_dt() %>%
mutate(hp=1, mpg=2, .keep='none')
#> Source: local data table [32 x 2]#> Call: copy(`_DT5`)[, `:=`(hp = 1, mpg = 2)][, `:=`(c("cyl", "disp", #> "drat", "wt", "qsec", "vs", "am", "gear", "carb"), NULL)]#> #> mpg hp#> <dbl> <dbl>#> 1 2 1#> 2 2 1#> 3 2 1#> 4 2 1#> 5 2 1#> 6 2 1#> 7 2 1#> 8 2 1#> 9 2 1#> 10 2 1#> # ℹ 22 more rows#> #> # Use as.data.table()/as.data.frame()/as_tibble() to access results
This will improve performance by preventing unnecessary copies in longer pipe chains.
The text was updated successfully, but these errors were encountered: