expr3present: indicates inclusion of character string In rbsb: set of ancillary functions

Description

Checks if some string(s) belong(s) to a series of strings. When `exact` is FALSE, returns TRUE if the character string `sch` is included at least once into the character string `ch`.
`sch` can be a vector, in that case, the check is made for each of its components. According to `how` the returned value is vectorial or scalar. When `sch` is zero length then `TRUE` is returned but if not and `ch` is zero length then `FALSE` is returned.

Usage

 `1` ```expr3present(sch, ch, exact=FALSE, how="a") ```

Arguments

 `sch` (`character`) the character string(s) to be found. `ch` (`character`) the character string(s) to investigate. `exact` When exact, one component must be strictly identical, if not a subtring is sufficient. `how` Indicates what to do when `length(sch)>1`. The choice are `'v'`: a logical vector gives back each check independently; `'1'`: returns `TRUE` when at least one of the component belongs to the series `ch` and `'a'` when all components must comply to get TRUE.

Value

A logical vector with length of `sch`.

Examples

 ```1 2 3 4 5 6``` ``` rbsb3k("RESET"); # needed only for R checking, to be forgotten expr3present('a', 'non'); expr3present('o', c('non', 'oui')); expr3present(c("o", "oui"), c('non', 'oui')); expr3present(c("o", "oui"), c('non', 'oui'), how="v"); expr3present(c("A[SEX]", "A[AGE]"), c("A[AGE]", "A[SEX]"), how="a") ```

rbsb documentation built on May 31, 2017, 1:45 a.m.