selectExpr,DataFrame,character-method {SparkR}R Documentation

SelectExpr

Description

Select from a DataFrame using a set of SQL expressions.

Usage

## S4 method for signature 'DataFrame,character'
selectExpr(x, expr, ...)

Arguments

x

A DataFrame to be selected from.

expr

A string containing a SQL expression

...

Additional expressions

Value

A DataFrame

Examples

## Not run: 
##D sc <- sparkR.init()
##D sqlContext <- sparkRSQL.init(sc)
##D path <- "path/to/file.json"
##D df <- jsonFile(sqlContext, path)
##D selectExpr(df, "col1", "(col2 * 5) as newCol")
## End(Not run)

[Package SparkR version 1.4.1 Index]