SparkR (version 2.4.6)

windowOrderBy: windowOrderBy

Description

Creates a WindowSpec with the ordering defined.

Usage

windowOrderBy(col, ...)

# S4 method for character windowOrderBy(col, ...)

# S4 method for Column windowOrderBy(col, ...)

Arguments

col

A column name or Column by which rows are ordered within windows.

...

Optional column names or Columns in addition to col, by which rows are ordered within windows.

Examples

Run this code
# NOT RUN {
  ws <- windowOrderBy("key1", "key2")
  df1 <- select(df, over(lead("value", 1), ws))

  ws <- windowOrderBy(df$key1, df$key2)
  df1 <- select(df, over(lead("value", 1), ws))
# }

Run the code above in your browser using DataCamp Workspace