mutate: Create or transform variables

Description Usage Arguments Value Examples

Description

mutate() adds new variables and preserves existing ones; transmute() adds new variables and drops existing ones. Both functions preserve the number of rows of the input.

Usage

1
2
3
4
## S3 method for class 'FDF'
mutate(.data, ...)

mutate(.data, ...)

Arguments

.data

A FDF.

...

Name-value pairs of expressions, each with length 1 or the same length as the number of rows in the group (if using group_by()) or in the entire input (if not using groups). The name of each argument will be the name of a new variable, and the value will be its corresponding value. Use a NULL value in mutate to drop a variable.

The arguments in ... are automatically quoted and evaluated in the context of the data frame. They support unquoting and splicing. See vignette("programming") for an introduction to these concepts.

Value

An object of the same class as .data.

Examples

1
2
3
(test <- FDF(datasets::airquality))
mutate(test, Temp_Celsius = (Temp - 32) / 1.8,
       Temp_Kelvin = Temp_Celsius + 273.15)

privefl/bigdfr documentation built on May 20, 2019, 9:39 a.m.