logic: Logical operators for selection objects

Description Usage Arguments Value See Also Examples

Description

%OR% is a version of | (the OR binary operator) which automatically invokes as.selection to coerce its argument to a selection (e.g. a character string is used by termhas to select terms).

%AND% is a version of & (the AND binary operator) which acts similarly, and NOT is a function which converts its argument to a selection and then negates it.

Usage

1
2
3
cond1 %OR% cond2
cond1 %AND% cond2
NOT(cond1)

Arguments

cond1

a selection object, or a character string which will be converted to a selection using termhas

cond2

another selection object or character string

Value

A selection object.

See Also

S3 Boolean operators for codelist objects: !.selection, |.selection, &.selection

Examples

1
2
3
4
5
6
setdictionary('icd10')
as.selection('angina') %OR% as.selection('myocardial infarction')
my1 <- as.selection('angina')  %AND% as.selection('unstable')
my2 <- 'angina' %AND% 'unstable'
identical(my1, my2)
'angina' %AND% NOT('unstable')

CALIBERcodelists documentation built on Feb. 28, 2020, 3:01 a.m.