get.plotted.events: Get info about the plotted events.

View source: R/plotting.R

get.plotted.eventsR 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:

  • the corresponding follow-up and observation windows (and, for CMA8, the "real" observation window), given as the corners of the area .X...START, .X...END, .Y...START and .Y...END (where the mid dot stands for FUW, OW and ROW, respectively).

  • the area occupied by the graphic representation of the event given by its four corners .X.START, .X.END, .Y.START and .Y.END, as well as the line width .EV.LWD.

  • the dose text's (if any) position (.X.DOSE, .Y.DOSE) and font size .FONT.SIZE.DOSE.

  • if event corvered and not covered are plotted, also give their areas as .X.EVC.START, .X.EVC.END, .Y.EVC.START, .Y.EVC.END, .X.EVNC.START, .X.EVNC.END, .Y.EVNC.START and .Y.EVNC.END.

  • the continuation lines area as .X.CNT.START, .X.CNT.END, .Y.CNT.START and .Y.CNT.END.

  • and the corresponding summary CMA (if any) given as the area .X.SCMA.START, .X.SCMA.END, .Y.SCMA.START and .Y.SCMA.END.

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

AdhereR documentation built on July 5, 2022, 5:08 p.m.