ddediu / AdhereR

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

Align patients for plotting doesn't work after update to 0.3 #13

Closed Masswear closed 6 years ago

Masswear commented 6 years ago

After updating to AdhereR 0.3, aligning patients in CMA0 plots does not seem to work anymore.

example_data <- med.events[med.events$PATIENT_ID %in% c(37, 76), ]

cma0 <- CMA0(data=example_data, # use the two selected patients
             ID.colname="PATIENT_ID", # the name of the column containing the IDs
             event.date.colname="DATE", # the name of the column containing the event date
             event.duration.colname="DURATION", # the name of the column containing the duration
             event.daily.dose.colname="PERDAY", # the name of the column containing the dosage
             medication.class.colname="CATEGORY", # the name of the column containing the category
             followup.window.start=0,  # FUW start in days since earliest event
             observation.window.start=182, # OW start in days since earliest event
             observation.window.duration=365, # OW duration in days
             date.format="%m/%d/%Y"); # date format (mm/dd/yyyy)

# Plot the object (CMA0 shows the actual event data only):
plot(cma0, # the object to plot
     align.all.patients=TRUE)
ddediu commented 6 years ago

Forgot to adjust the cached date column (I was still adjusting the original, which was not used for plotting anymore) :)