Learn R Programming

SparkR (version 3.1.2)

windowPartitionBy: windowPartitionBy

Description

Creates a WindowSpec with the partitioning defined.

Usage

windowPartitionBy(col, ...)

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

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

Arguments

col

A column name or Column by which rows are partitioned to windows.

...

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

Examples

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

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

Run the code above in your browser using DataLab