lag {SparkR} | R Documentation |
Window function: returns the value that is 'offset' rows before the current row, and 'defaultValue' if there is less than 'offset' rows before the current row. For example, an 'offset' of one will return the previous row at any given point in the window partition.
## S4 method for signature 'characterOrColumn' lag(x, offset, defaultValue = NULL) lag(x, ...)
This is equivalent to the LAG function in SQL.
Other window_funcs: cume_dist
,
cume_dist
; dense_rank
,
dense_rank
; lead
,
lead
; ntile
,
ntile
; percent_rank
,
percent_rank
; rank
,
rank
; row_number
,
row_number
## Not run: lag(df$c)