first {SparkR}R Documentation

Return the first row of a DataFrame

Description

Return the first row of a DataFrame

Aggregate function: returns the first value in a group.

Usage

## S4 method for signature 'DataFrame'
first(x)

## S4 method for signature 'Column'
first(x)

Arguments

x

A SparkSQL DataFrame

See Also

Other agg_funcs: approxCountDistinct, approxCountDistinct, approxCountDistinct; avg, avg; countDistinct, countDistinct, countDistinct, n_distinct; count, count, count, n, nrow; last, last; max; mean; min; sumDistinct, sumDistinct; sum

Examples

## Not run: 
##D sc <- sparkR.init()
##D sqlContext <- sparkRSQL.init(sc)
##D path <- "path/to/file.json"
##D df <- jsonFile(sqlContext, path)
##D first(df)
## End(Not run)
## Not run: first(df$c)

[Package SparkR version 1.5.1 Index]