This function serves as a convenience wrapper of dplyr::summarise(), which takes the grouped variables and summarises their gaps in therapy. This function is to be used after propagate_date().

summarise_gaps(.data)

Arguments

.data

Data to be piped into the function

Value

A summary of gaps in therapy

Note

This function relies an adjusted_date column to identify gaps in therapy. So, if you don't want to use propagate_date() beforehand, you'll need to rename the date variable you wish to use to adjusted_date.

Examples

library(adheRenceRX) library(dplyr) toy_claims %>% filter(ID == "D") %>% propagate_date(.date_var = date, .days_supply_var = days_supply) %>% summarise_gaps()
#> # A tibble: 1 x 1 #> Sum_Of_Gaps #> <dbl> #> 1 30