Combine events with overlapping start/end dates.
Arguments
- events
Event file
- states
Events of interest in the data. If NULL, assume all events are of interest.
- gap
Gap (in days) to apply in prescriptions of the same type. Useful when the gap should only apply to link together identical states (if the allowable gap is to be applied universally, can be added to
endprior to using the function)- id_var
Group identifier in the data. Default is
patient_id