# NOT RUN {
cma7 <- CMA7(data=med.events[med.events$PATIENT_ID %in% c(1,2),],
ID.colname="PATIENT_ID",
event.date.colname="DATE",
event.duration.colname="DURATION",
event.daily.dose.colname="PERDAY",
medication.class.colname="CATEGORY",
followup.window.start=0,
followup.window.start.unit="days",
followup.window.duration=2*365,
followup.window.duration.unit="days",
observation.window.start=30,
observation.window.start.unit="days",
observation.window.duration=365,
observation.window.duration.unit="days",
date.format="%m/%d/%Y",
summary="Base CMA");
plot(cma7);
tmp <- get.plotted.events();
head(tmp);
# "Mask" the first event:
rect(tmp$.X.START[1], tmp$.Y.START[1]-0.5, tmp$.X.END[1], tmp$.Y.END[1]+0.5,
col=adjustcolor("white",alpha.f=0.75), border="black");
# "Mask" the first patient's summary CMA:
rect(tmp$.X.SCMA.START[1], tmp$.Y.SCMA.START[1],
tmp$.X.SCMA.END[1], tmp$.Y.SCMA.END[1],
col=adjustcolor("white",alpha.f=0.75), border="black");
# }
Run the code above in your browser using DataLab