ival_var
overlaps with interval created based on index_date
, time_before
and time_after
.R/filter.R
filter_ival_olap_ival.Rd
Filtering of date interval data within study interval.
Can be used for filtering e.g. for hospital visits, which are date intervals (time periods).
The function finds rows for which ival_var
overlaps with interval created based on index_date
, time_before
and time_after
.
filter_ival_olap_ival( .data, ival_var, index_date, time_before = years(2), time_after = days(0) )
ival_var | the interval to be filtered |
---|---|
index_date | date or other lubridate variable as reference point around which to search |
time_before | the time before the index date what defines the start of filtering interval (lubridate format, e.g years(1), weeks(10), days(20) etc.) |
time_after | the time after the index date (default is 0 days) what defines the start of filtering interval (lubridate format, e.g years(1), weeks(10), days(20) etc.) |
returns a tibble object with filtered rows
filter_date_in_ival
for date filtering by fixed interval
Other filter functions:
filter_date_in_ival()