count {SparkR}R Documentation

Count

Description

Returns the number of rows in a DataFrame

Aggregate function: returns the number of items in a group.

Aggregate function: returns the number of items in a group.

Usage

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

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

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

n(x)

Arguments

x

A SparkSQL DataFrame

See Also

Other agg_funcs: approxCountDistinct, approxCountDistinct, approxCountDistinct; avg, avg; countDistinct, countDistinct, countDistinct, n_distinct; first, first; last, last; max; mean; min; sumDistinct, sumDistinct; sum

Other agg_funcs: approxCountDistinct, approxCountDistinct, approxCountDistinct; avg, avg; countDistinct, countDistinct, countDistinct, n_distinct; first, first; 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 count(df)
## End(Not run)
## Not run: count(df$c)

[Package SparkR version 1.5.2 Index]