Description Usage Arguments Value Examples
Given a series of prescriptions in data
, if one prescription
(for the same patient and drug) starts ≤q min_gap
days
after the previous one finishes, we extend the length of the previous
prescription to cover the gap.
1 | close_small_gaps(data, min_gap = 0L)
|
data |
A data frame containing columns |
min_gap |
Size of largest gaps to close. Default is zero, i.e. do nothing |
The input data frame data
, possibly with some of the
stop_date
s changed.
1 2 3 4 5 6 7 8 | gappy_data <- data.frame(
patid = 1,
prodcode = 'a',
start_date = Sys.Date() + (0:6) * 7,
stop_date = Sys.Date() + (0:6) * 7 + 4
)
close_small_gaps(gappy_data)
close_small_gaps(gappy_data, 7)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.