createDataFrame {SparkR}R Documentation

Create a DataFrame

Description

Converts R data.frame or list into DataFrame.

Usage

createDataFrame(sqlContext, data, schema = NULL, samplingRatio = 1)

as.DataFrame(sqlContext, data, schema = NULL, samplingRatio = 1)

Arguments

sqlContext

A SQLContext

data

An RDD or list or data.frame

schema

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

Value

an DataFrame

Examples

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

[Package SparkR version 1.6.1 Index]