transform: Transform a Datasets

Description Usage Arguments Details Value See Also Examples

Description

Modify or add columns to a dataset.

Usage

1
2
## S3 method for class 'dataset'
transform(`_data`, ...)

Arguments

_data

a dataset object.

...

expressions used to modify or update the dataset.

Details

The transform function converts its first argument to a dataset, then evaluates the quoted remaining arguments using scope. Named arguments replace the corresponding columns in x, or get appended if the names don't already exist; unnamed arguments get names taken from their quoted values.

Value

The modified dataset with the new columns.

See Also

select.dataset, scope.

Examples

1
2
3
4
transform.dataset(mtcars, cyl = 2 * cyl) # modify an existing column

x <- as.dataset(iris)
transform(x, area = Sepal.Length * Sepal.Width) # add a new column

patperry/r-frame documentation built on May 6, 2019, 8:34 p.m.