cume_dist {SparkR}R Documentation

cume_dist

Description

Window function: returns the cumulative distribution of values within a window partition, i.e. the fraction of rows that are below the current row.

Usage

## S4 method for signature 'missing'
cume_dist()

cume_dist(x = "missing")

Arguments

x

empty. Should be used with no argument.

Details

N = total number of rows in the partition cume_dist(x) = number of values before (and including) x / N

This is equivalent to the CUME_DIST function in SQL.

Note

cume_dist since 1.6.0

See Also

Other window_funcs: dense_rank, dense_rank, dense_rank,missing-method; lag, lag, lag,characterOrColumn-method; lead, lead, lead,characterOrColumn,numeric-method; ntile, ntile, ntile,numeric-method; percent_rank, percent_rank, percent_rank,missing-method; rank, rank, rank, rank,ANY-method, rank,missing-method; row_number, row_number, row_number,missing-method

Examples

## Not run: 
##D   df <- createDataFrame(mtcars)
##D   ws <- orderBy(windowPartitionBy("am"), "hp")
##D   out <- select(df, over(cume_dist(), ws), df$hp, df$am)
## End(Not run)

[Package SparkR version 2.2.0 Index]