
Check eligibility based on no events in prior window (excluding baseline week)
Source:R/skeleton_utils.R
skeleton_eligible_no_events_in_window_excluding_wk0.RdAdds a logical column indicating whether there were NO TRUE values in the
specified event variable within the prior window, EXCLUDING the current
(baseline) week. The window counts ISO weeks from isoyearweek, as
any_events_prior_to() describes.
Usage
skeleton_eligible_no_events_in_window_excluding_wk0(
dt,
event_var,
window = 52,
col_name = NULL
)Arguments
- dt
A data.table with
id,isoyearweekand the specified event variable. Within eachid, the rows MUST be in calendar order.- event_var
Character. Name of a logical column indicating event occurrence.
- window
Number of prior ISO weeks to check. 99999 or more,
Infincluded, means every earlier row. Default: 52.- col_name
Character or NULL. Name of the eligibility column to create.