Description Usage Arguments Value Note Examples
Converts R data.frame or list into SparkDataFrame.
1 2 3 | createDataFrame(data, schema = NULL, samplingRatio = 1, numPartitions = NULL)
as.DataFrame(data, schema = NULL, samplingRatio = 1, numPartitions = NULL)
|
data |
a list or data.frame. |
schema |
a list of column names or named list (StructType), optional. |
samplingRatio |
Currently not used. |
numPartitions |
the number of partitions of the SparkDataFrame. Defaults to 1, this is limited by length of the list or number of rows of the data.frame |
A SparkDataFrame.
createDataFrame since 1.4.0
as.DataFrame since 1.6.0
1 2 3 4 5 6 7 8 | ## Not run:
sparkR.session()
df1 <- as.DataFrame(iris)
df2 <- as.DataFrame(list(3,4,5,6))
df3 <- createDataFrame(iris)
df4 <- createDataFrame(cars, numPartitions = 2)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.