arrange: Arrange the rows in an Xdf file

Description Usage Arguments Details Value See Also Examples

Description

Arrange the rows in an Xdf file

Usage

1
2
3
4
5
6
7
8
9
## S3 method for class 'RxXdfData'
arrange(.data, ..., .by_group = FALSE,
  .outFile = tbl_xdf(.data), .rxArgs)

## S3 method for class 'RxFileData'
arrange(.data, ...)

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

Arguments

...

List of unquoted variable names. Use desc to sort in descending order.

.by_group

If TRUE, will sort first by grouping variables.

.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.

data

An Xdf data source, tbl, or other RevoScaleR file data source.

Details

The underlying RevoScaleR function is rxSort. This has many sorting options, including removing duplicated keys, adding a column of frequency counts, and so on.

Due to limitations in rxSort, this verb does not support data stored in HDFS.

Value

An object representing the sorted data. This depends on the .outFile argument: by default, 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

rxSort, arrange in package dplyr

Examples

1
2
3
4
5
6
7
8
mtx <- as_xdf(mtcars, overwrite=TRUE)
tbl <- arrange(mtx, cyl, disp)
as.data.frame(tbl)
tbl2 <- arrange(mtx, desc(disp))
as.data.frame(tbl2)

# Saving to a persistent Xdf file
arrange(mtx, cyl, disp, .outFile="mtcars_sorted.xdf")

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