identify_gaps {adheRenceRX}R Documentation

Identify Gaps in Therapy

Description

Compute gaps in a patient's therapy from the end of their prior fill to the beginning of the next. This function assumes that one has arranged the dates and grouped appropriately outside of the function. The length of any gap will be appended to the row after the gap has occurred.

Usage

identify_gaps(.data)

Arguments

.data

data frame

Value

A new claims tibble with an appended column, gap

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) %>% 
  identify_gaps()



[Package adheRenceRX version 1.0.0 Index]