mutate - SoojungHong/R_General GitHub Wiki

To edit or add columns to a data.frame, you can use mutate from the dplyr package:

library(dplyr) mtcars %>% mutate(new_column = mpg + wt)