ddediu / AdhereR

Computation of adherence to medications from Electronic Healthcare Data in R
26 stars 6 forks source link

plot.CMA = TRUE does not drw the alternating background behind the partial CMAs #149

Closed ddediu closed 3 years ago

ddediu commented 3 years ago
cma7 <- CMA_sliding_window(CMA.to.apply = "CMA7",
                           data=med.events[med.events$PATIENT_ID %in% c(1,2,3),],
                           ID.colname = "PATIENT_ID",
                           event.date.colname = "DATE",
                           event.duration.colname = "DURATION",
                           medication.class.colname = "CATEGORY",
                           #event.daily.dose.colname = "Min",
                           carry.only.for.same.medication = FALSE,
                           followup.window.start = 0,
                           followup.window.start.unit = "days",
                           followup.window.duration = 540,
                           followup.window.duration.unit = "days",
                           observation.window.start = 180,
                           observation.window.start.unit = "days",
                           observation.window.duration = 180,
                           observation.window.duration.unit = "days",
                           sliding.window.start = 0,
                           sliding.window.start.unit = "days",
                           sliding.window.duration = 90,
                           sliding.window.duration.unit = "days",
                           sliding.window.step.duration = 180,
                           sliding.window.step.unit = "days",
                           sliding.window.no.steps = 2,
                           date.format = "%m/%d/%Y")

Compare: plot.CMA = TRUE with plot.CMA = FALSE below for patient 2:

plot(cma7, show.period = "dates",
     period.in.days = 60,
     show.legend = FALSE,
     ylab = c(withCMA = "Section - Drug Name"),
     cex.axis = 1,
     title = "WHATEVER",
     CMA.cex = 0.5, #0.8,
     plot.CMA = TRUE, #FALSE,
     #print.dose = TRUE,
     plot.CMA.as.histogram = F,
     CMA.plot.ratio = 0.000000000000000000000001, 
     min.plot.size.in.characters.horiz=0,
     min.plot.size.in.characters.vert=0,
     force.draw.text=TRUE)
ddediu commented 3 years ago

Fixed