countDistinct {SparkR}R Documentation

Count Distinct Values

Description

Count Distinct Values

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

Usage

countDistinct(x, ...)

n_distinct(x, ...)

## S4 method for signature 'Column'
countDistinct(x, ...)

## S4 method for signature 'Column'
n_distinct(x, ...)

Arguments

x

Column to compute on

...

other columns

Value

the number of distinct items in a group.

Note

countDistinct since 1.4.0

n_distinct since 1.4.0

See Also

Other agg_funcs: agg, avg, count, first, kurtosis, last, max, mean, min, sd, skewness, stddev_pop, stddev_samp, sumDistinct, sum, var_pop, var_samp, var

Examples

## Not run: countDistinct(df$c)
## Not run: n_distinct(df$c)

[Package SparkR version 2.2.2 Index]