agg {SparkR}R Documentation

Count

Description

Count the number of rows for each group. The resulting SparkDataFrame will also contain the grouping columns.

Compute aggregates by specifying a list of columns

Usage

agg(x, ...)

summarize(x, ...)

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

## S4 method for signature 'SparkDataFrame'
agg(x, ...)

## S4 method for signature 'SparkDataFrame'
summarize(x, ...)

Arguments

x

a GroupedData

x

a SparkDataFrame

Value

a SparkDataFrame

See Also

Other SparkDataFrame functions: SparkDataFrame-class, [[, arrange, as.data.frame, attach, cache, collect, colnames, coltypes, columns, count, dapply, describe, dim, distinct, dropDuplicates, dropna, drop, dtypes, except, explain, filter, first, group_by, head, histogram, insertInto, intersect, isLocal, join, limit, merge, mutate, ncol, persist, printSchema, registerTempTable, rename, repartition, sample, saveAsTable, selectExpr, select, showDF, show, str, take, unionAll, unpersist, withColumn, write.df, write.jdbc, write.json, write.parquet, write.text

Examples

## Not run: 
##D   count(groupBy(df, "name"))
## End(Not run)

[Package SparkR version 2.0.0 Index]