createDataFrame {SparkR} | R Documentation |
Converts R data.frame or list into DataFrame.
createDataFrame(sqlContext, data, schema = NULL, samplingRatio = 1) as.DataFrame(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 df1 <- as.DataFrame(sqlContext, iris)
##D df2 <- as.DataFrame(sqlContext, list(3,4,5,6))
##D df3 <- createDataFrame(sqlContext, iris)
## End(Not run)