Learn R Programming

CodelistGenerator (version 3.5.0)

subsetOnDoseUnit: Subset a codelist to only those with a particular dose unit.

Description

Subset a codelist to only those with a particular dose unit.

Usage

subsetOnDoseUnit(x, cdm, doseUnit, negate = FALSE)

Value

The codelist with only those concepts associated with the dose unit (if negate = FALSE) or codelist without those concepts associated with the dose unit(if negate = TRUE).

Arguments

x

A codelist.

cdm

A cdm reference via CDMConnector.

doseUnit

Only codes with the specified dose unit will be returned. If NULL, descendant codes will be returned regardless of dose unit Use 'getDoseUnit()' to see the available dose units.

negate

If FALSE, only concepts with the dose unit specified will be returned. If TRUE, concepts with the dose unit specified will be excluded.

Examples

Run this code
# \donttest{
library(CodelistGenerator)
cdm <- mockVocabRef()
codes <- subsetOnDoseUnit(x = list("codes" = c(20,21)),
                          cdm = cdm,
                          doseUnit = c("milligram"))

codes
# }

Run the code above in your browser using DataLab