ntile {SparkR}R Documentation

ntile

Description

Window function: returns the ntile group id (from 1 to 'n' inclusive) in an ordered window partition. Fow example, if 'n' is 4, the first quarter of the rows will get value 1, the second quarter will get 2, the third quarter will get 3, and the last quarter will get 4.

Usage

## S4 method for signature 'numeric'
ntile(x)

ntile(x)

Details

This is equivalent to the NTILE function in SQL.

See Also

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

Examples

## Not run: ntile(1)

[Package SparkR version 1.6.3 Index]