- data
A data.frame or remote table that contains the id and date variables.
- clnt_id
Column name of subject/person ID.
- start_dt
Column name of the starting date of records.
- end_dt
Column name of the end date of records. The default is NULL assuming the record last one day and only the start date will be used to calculate the gaps between records.
- gap
A number in days that will be used to separate episodes. For example, gap = 7 means collapsing records no more than 7 days apart. Note that the number of days apart will be calculated as numeric difference between two days, so that 2020-01-07 and 2020-01-01 is considered as 6 days apart.
- overwrite
Column name of a grouping variable determining whether the consecutive records are related and should have a different gap value. For example, dispensing records may have the same original prescription number, and a different gap value can be assigned for such situation, e.g., the days between two records is > gap, but these records still belong to the same prescription.
- gap_overwrite
A different gap value used for related records. The default is 99999, which practically means all records with the same overwrite variable will be collapsed.
- .dt_trans
Function to transform start_dt/end_dt. For data.frame input only. Default is data.table::as.IDate().
- ...
Additional arguments passing to the .dt_trans function. For data.frame input only.