structType {SparkR} | R Documentation |
Create a structType object that contains the metadata for a DataFrame. Intended for use with createDataFrame and toDF.
structType(x, ...)
x |
a structField object (created with the field() function) |
... |
additional structField objects |
a structType object
## Not run:
##D sc <- sparkR.init()
##D sqlCtx <- sparkRSQL.init(sc)
##D rdd <- lapply(parallelize(sc, 1:10), function(x) { list(x, as.character(x)) })
##D schema <- structType(structField("a", "integer"), structField("b", "string"))
##D df <- createDataFrame(sqlCtx, rdd, schema)
## End(Not run)