Skip to contents

Apply lookback door sliding window pooling to co-occurrence data

Usage

lookback_door(
  data,
  cols_of_interest,
  lookback_size = 100L,
  unit_col = "ENA_UNIT_base",
  aggregate = c("sum", "mean"),
  weighting = c("equal", "linear"),
  segment_col = NULL
)

Arguments

data

Data frame with co-occurrence columns

cols_of_interest

Character vector of code-pair columns

lookback_size

Window lookback size (single integer, named vector, or data.frame)

unit_col

Name of column identifying unit

aggregate

"sum" or "mean"

weighting

"equal" or "linear"

segment_col

Optional segment column to reset window

Value

Data frame with door_* columns attached