createDataFrame {SparkR}R Documentation

Create a SparkDataFrame

Description

Converts R data.frame or list into SparkDataFrame.

Usage

## Default S3 method:
createDataFrame(data, schema = NULL, samplingRatio = 1)

## Default S3 method:
as.DataFrame(data, schema = NULL, samplingRatio = 1)

as.DataFrame(data, ...)

Arguments

data

an RDD or list or data.frame.

schema

a list of column names or named list (StructType), optional.

samplingRatio

Currently not used.

...

additional argument(s).

Value

A SparkDataFrame.

Note

createDataFrame since 1.4.0

as.DataFrame since 1.6.0

Examples

## Not run: 
##D sparkR.session()
##D df1 <- as.DataFrame(iris)
##D df2 <- as.DataFrame(list(3,4,5,6))
##D df3 <- createDataFrame(iris)
## End(Not run)

[Package SparkR version 2.0.2 Index]