gantt: Gantt Chart of Adherence

Description Usage Arguments Value Examples

Description

gantt() returns a Gantt chart rendered by ggplot of the adherence before and after indexing by the proprotion_days_covered() function for a specific patient of interest!

Usage

1
gantt(x, id)

Arguments

x

the list of data frames returned from the proportion_days_covered() function

ID

the ID of the patient of interest

Value

a Gantt Chart from the timevis package for a specific patient

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
test_frame <- tibble(
                   ID = c(rep("21", 5), rep("48", 3), rep("59", 8)),
                   date = c(as.POSIXct(rep("2018-10-11",3), tz = "UTC"),
                          as.POSIXct("2018-11-11", tz = "UTC"),
                          as.POSIXct("2018-12-11", tz = "UTC")
                          as.POSIXct(rep("2018-08-27", 2), tz = "UTC"),
                          as.POSIXct("2018-11-15", tz = "UTC"),
                          as.POSIXct(rep("2018-04-28", 5), tz = "UTC"),
                          as.POSIXct(rep("2018-12-25", 3), tz = "UTC")),
                   days_supply = c(30, 30, 60, 90, 30, 30, 60, 15, 30, 30, 60, 90, 30, 30, 30, 90),
                   drug = c("x", "x", "y", "y", "y", "x", "y", "x", "x", "x", "x", "y", "y", "x", "x", "y")
                  )

new_frame <- proportion_days_covered(x = test_frame,
                                     date_var = date,
                                     day_supply_var = days_supply,
                                     drug_var = drug,
                                     pt_id_var = ID)

your_chart <- gantt(x = new_frame, id = 21)

btbeal/adheRenceRX documentation built on June 5, 2019, 11:02 a.m.