get.plotted.events {AdhereR}R Documentation

Get info about the plotted events.

Description

Returns a data.frame where each row contains info about one plotted event; the order of the rows reflects the y-axis (first row on bottom).

Usage

get.plotted.events(plot.type = c("baseR", "SVG")[1], suppress.warnings = FALSE)

Arguments

plot.type

Can be either "baseR" or "SVG" and specifies to which type of plotting the mapping applies.

suppress.warnings

Logical, if TRUE don't show any warnings.

Details

This is intended for advanced users only.

Value

A data.frame that, besides the info about each event, also contains info about:

Please note that even if with follow-up and ("real") observation window, and the summary CMA info is repeated for each event, they really make sense at the level of the patient.

Examples

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");

[Package AdhereR version 0.8.1 Index]