df <- data.table(
x = rep(1, 3),
y = rep(2, 3),
z = c("a", "a", "b")
)
df %>%
mutate.(across.(c(x, y), ~ .x * 2))
df %>%
summarize.(across.(c(x, y), ~ mean(.x, na.rm = TRUE)), .by = z)
df %>%
arrange.(across.(c(y, z)))
Run the code above in your browser using DataLab