subsetCMA: Restrict a CMA object to a subset of patients.

View source: R/adherer.R

subsetCMAR Documentation

Restrict a CMA object to a subset of patients.

Description

Restrict a CMA object to a subset of patients.

Usage

subsetCMA(cma, patients, suppress.warnings)

Arguments

cma

a CMA object.

patients

a list of patient IDs to keep.

suppress.warnings

Logical, if TRUE don't show any warnings.

Value

a CMA object containing only the information for the given patients.

Examples

cma1 <- CMA1(data=med.events,
             ID.colname="PATIENT_ID",
             event.date.colname="DATE",
             event.duration.colname="DURATION",
             followup.window.start=30,
             observation.window.start=30,
             observation.window.duration=365,
             date.format="%m/%d/%Y"
            );
getCMA(cma1);
cma1a <- subsetCMA(cma1, patients=c(1:3,7));
cma1a; getCMA(cma1a);

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