Logic {CALIBERcodelists} | R Documentation |
%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.
cond1 %OR% cond2 cond1 %AND% cond2 NOT(cond1)
cond1 |
a selection object, or a character string which will be converted to a selection using |
cond2 |
another selection object or character string |
A selection object.
S3 Boolean operators for codelist objects: !.selection
, |.selection
, &.selection
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')