select: Select columns in a data source

Description Usage Arguments Details Value See Also Examples

Description

Select columns in a data source

Usage

1
2
3
4
5
## S3 method for class 'RxFileData'
select(.data, ..., .outFile = tbl_xdf(.data), .rxArgs)

## S3 method for class 'RxDataSource'
select(.data, ...)

Arguments

.data

A data source.

...

Unquoted variables to select.

.outFile

Output format for the returned data. If not supplied, create an xdf tbl; if NULL, return a data frame; if a character string naming a file, save an Xdf file at that location.

.rxArgs

A list of RevoScaleR arguments. See rxArgs for details.

Details

All the special functions mentioned in the documentation for select will also work with dplyrXdf. Note that renaming a variable is not supported in dplyrXdf select. If you want to do this, follow the select with a rename; the latter is very fast, as it only modifies the metadata portion of an xdf file, not the data itself.

Value

An object representing the transformed data. This depends on the .outFile argument: if missing, it will be an xdf tbl object; if NULL, a data frame; and if a filename, an Xdf data source referencing a file saved to that location.

See Also

select in package dplyr, subset

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
mtx <- as_xdf(mtcars, overwrite=TRUE)
tbl <- select(mtx, mpg, cyl)
names(tbl)

# filter on rows and columns simultaneously with .rxArgs
tbl2 <- select(mtx, mpg, cyl, .rxArgs=list(rowSelection=am == 1 & vs == 1))
dim(tbl2)

# save to a persistent Xdf file
select(mtx, mpg, cyl, .outFile="mtcars_select.xdf")

RevolutionAnalytics/dplyrXdf documentation built on June 3, 2019, 9:08 p.m.