row_number {SparkR}R Documentation

row_number

Description

Window function: returns a sequential number starting at 1 within a window partition.

Usage

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

row_number(x = "missing")

Arguments

x

empty. Should be used with no argument.

Details

This is equivalent to the ROW_NUMBER function in SQL.

Note

row_number since 1.6.0

See Also

Other window_funcs: cume_dist, cume_dist, cume_dist,missing-method; 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

Examples

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

[Package SparkR version 2.0.2 Index]