createDataFrame {SparkR} | R Documentation |
Converts an RDD to a DataFrame by infer the types.
createDataFrame(sqlContext, data, schema = NULL, samplingRatio = 1)
sqlContext |
A SQLContext |
data |
An RDD or list or data.frame |
schema |
a list of column names or named list (StructType), optional |
an DataFrame
## Not run:
##D sc <- sparkR.init()
##D sqlContext <- sparkRSQL.init(sc)
##D rdd <- lapply(parallelize(sc, 1:10), function(x) list(a=x, b=as.character(x)))
##D df <- createDataFrame(sqlContext, rdd)
## End(Not run)