Add/modify/delete columns
With mutate.()
you can do 3 things:
Add new columns
Modify existing columns
Delete columns
mutate.(.df, ..., .by = NULL)
.df |
A data.frame or data.table |
... |
Columns to add/modify |
.by |
Columns to group by |
test_df <- data.table( a = c(1,2,3), b = c(4,5,6), c = c("a","a","b") ) test_df %>% mutate.(double_a = a * 2, a_plus_b = a + b) test_df %>% mutate.(double_a = a * 2, avg_a = mean(a), .by = c)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.