mutate is a verb to create a new column in a data frame using dplyr package in R programming language.
When using dplyr for data wrangling, mutate is commonly used to add a new column to a data frame. With a data frame df
, mutate(df, a = 3)
adds a constant column 3
to the data frame.
For more information on related verbs in dplyr and more examples on how to use mutate check the official help page.
Note that as of dplyr version 1.0.0, the scoped helpers (including mutate_if
, mutate_at
and mutate_all
) have been superseded by across()
(see the official change-log).