lead {SparkR}R Documentation

lead

Description

Window function: returns the value that is 'offset' rows after the current row, and 'null' if there is less than 'offset' rows after the current row. For example, an 'offset' of one will return the next row at any given point in the window partition.

Usage

## S4 method for signature 'characterOrColumn,numeric'
lead(x, offset, defaultValue = NULL)

lead(x, offset, defaultValue = NULL)

Details

This is equivalent to the LEAD function in SQL.

See Also

Other window_funcs: cume_dist, cume_dist; dense_rank, dense_rank; lag, lag; ntile, ntile; percent_rank, percent_rank; rank, rank; row_number, row_number

Examples

## Not run: lead(df$c)

[Package SparkR version 1.6.0 Index]