powered by
Window function: returns a sequential number starting at 1 within a window partition.
row_number(x = "missing")# S4 method for missing row_number()
# S4 method for missing row_number()
empty. Should be used with no argument.
This is equivalent to the ROW_NUMBER function in SQL.
Other window_funcs: cume_dist, dense_rank, lag, lead, ntile, percent_rank, rank
cume_dist
dense_rank
lag
lead
ntile
percent_rank
rank
# NOT RUN { df <- createDataFrame(mtcars) ws <- orderBy(windowPartitionBy("am"), "hp") out <- select(df, over(row_number(), ws), df$hp, df$am) # }
Run the code above in your browser using DataLab