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.
lag(x, ...) ## S4 method for signature 'characterOrColumn' lag(x, offset, defaultValue = NULL)
This is equivalent to the LAG function in SQL.
Other window_funcs: cume_dist
,
dense_rank
, lead
,
ntile
, percent_rank
,
rank
, row_number
## Not run: lag(df$c)