Skip to contents

Collects all the elements of a SparkDataFrame and coerces them into an R data.frame.

Usage

collect(x, ...)

# S4 method for SparkDataFrame
collect(x, stringsAsFactors = FALSE)

Arguments

x

a SparkDataFrame.

...

further arguments to be passed to or from other methods.

stringsAsFactors

(Optional) a logical indicating whether or not string columns should be converted to factors. FALSE by default.

Note

collect since 1.4.0

Examples

if (FALSE) {
sparkR.session()
path <- "path/to/file.json"
df <- read.json(path)
collected <- collect(df)
class(collected)
firstName <- names(collected)[1]
}