Code
dt %>% rename_with(1)
Condition
Error in `rename_with()`:
! `.fn` must be a function name or formula
Code
dt %>% rename_with(toupper) %>% show_query()
Output
setnames(copy(DT), toupper)
Code
dt %>% rename_with(toupper, 1:3) %>% show_query()
Output
setnames(copy(DT), c("a", "b", "c"), toupper)
Code
dt %>% distinct(z = x + y) %>% show_query()
Output
unique(copy(dt)[, `:=`(z = x + y)][, `:=`(c("x", "y"), NULL)])
Code
collect(drop_na(dt, "z"))
Condition
Error in `drop_na()`:
! Can't select columns that don't exist.
x Column `z` doesn't exist.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.