Skip to contents

Adds a logical column indicating whether there were NO TRUE values in the specified event variable within the prior window, EXCLUDING the current (baseline) week.

Usage

skeleton_eligible_no_events_in_window_excluding_wk0(
  dt,
  event_var,
  window = 52,
  col_name = NULL
)

Arguments

dt

A data.table with the specified event variable.

event_var

Character. Name of a logical column indicating event occurrence.

window

Integer or Inf. Number of prior weeks to check. Default: 52.

col_name

Character or NULL. Name of the eligibility column to create.

Value

The input data.table (invisibly), modified by reference.

Examples

if (FALSE) { # \dontrun{
temp |>
  skeleton_eligible_no_events_in_window_excluding_wk0("icd10_f20_f29", window = Inf)
} # }