logicSelection {CALIBERcodelists}R Documentation

Boolean operators for the S3 selection class

Description

Selection objects are physically stored as a logical (Boolean) vector as long as the number of rows in CALIBER_DICT, stating whether each term is included or excluded from the current selection. Selection objects can be combined using Boolean operators, with the result returned as a selection object.

Usage

## S3 method for class 'selection'
!x
## S3 method for class 'selection'
e1 & e2
## S3 method for class 'selection'
e1 | e2

Arguments

x

a selection object

e1

a selection object

e2

a selection object

Value

x & y returns terms included in both x and y

x | y returns terms included in either x or y

!x returns the selection of terms not included in x

See Also

%AND%, %OR%, NOT

Examples

setdictionary('icd10')
exposure <- termhas('exposure')
tb <- termhas('tuberculosis')
exposure & tb
exposure | tb

[Package CALIBERcodelists version 0.2-11 Index]