structType {SparkR}R Documentation

structType

Description

Create a structType object that contains the metadata for a DataFrame. Intended for use with createDataFrame and toDF.

Usage

structType(x, ...)

Arguments

x

a structField object (created with the field() function)

...

additional structField objects

Value

a structType object

Examples

## 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)

[Package SparkR version 1.5.1 Index]