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

Description Usage Arguments Value Examples

View source: R/adherer.R

Description

Restrict a CMA object to a subset of patients.

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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 Sept. 18, 2021, 5:07 p.m.