mutate {dplyr} | R Documentation |
Mutate adds new variables and preserves existing; transmute drops existing variables.
mutate(.data, ...) mutate_(.data, ..., .dots) transmute(.data, ...) transmute_(.data, ..., .dots)
.data |
A tbl. All main verbs are S3 generics and provide methods
for |
... |
Name-value pairs of expressions. Use |
.dots |
Used to work around non-standard evaluation. See
|
An object of the same class as .data
.
Data frame row names are silently dropped. To preserve, convert to an explicit variable.
Other single.table.verbs: arrange
,
filter
, select
,
slice
, summarise
mutate(mtcars, displ_l = disp / 61.0237) transmute(mtcars, displ_l = disp / 61.0237) mutate(mtcars, cyl = NULL)