mutate: Add new variables.

Description Usage Arguments Value See Also Examples

View source: R/manip.r

Description

Mutate adds new variables and preserves existing; transmute drops existing variables.

Usage

1
2
3
4
5
6
7
mutate(.data, ...)

mutate_(.data, ..., .dots)

transmute(.data, ...)

transmute_(.data, ..., .dots)

Arguments

.data

A tbl. All main verbs are S3 generics and provide methods for tbl_df, tbl_dt and tbl_sql.

...

Name-value pairs of expressions. Use NULL to drop a variable.

.dots

Used to work around non-standard evaluation. See vignette("nse") for details.

Value

An object of the same class as .data.

Data frame row names are silently dropped. To preserve, convert to an explicit variable.

See Also

Other single.table.verbs: arrange, filter, select, slice, summarise

Examples

1
2
3
4
mutate(mtcars, displ_l = disp / 61.0237)
transmute(mtcars, displ_l = disp / 61.0237)

mutate(mtcars, cyl = NULL)

sctyner/dplyr050 documentation built on May 17, 2019, 2:22 p.m.