occurrencesLessThan: Identifies Infrequent inverseRegex Patterns in an R Object.
Description
Calls inverseRegex on the input object and identifies values that
occur infrequently.
Usage
occurrencesLessThan(x, fraction = 0.05, n = NULL, ...)
Value
A collection of logical values with TRUE indicating entries with
an infrequent regex pattern. The class of the return value will depend on the
input object; matrices, data frames, and tibbles will be returned in kind; all
others are returned as vectors.
Arguments
x
Object to analyse for infrequent regex patterns.
fraction
Fraction of the R object size; regex patterns that occur less
(or equal) often than this will be identified. For a vector this fraction will
be multiplied by the length of the object; for a matrix it will be multiplied by
the total number of entries; and for a data frame or tibble it will be multiplied
by the number of rows. Defaults to 0.05.
n
Alternative to the fraction argument which allows a literal
number of occurrences to be searched for. Defaults to NULL, in which case
fraction will be used.
...
Other arguments to be passed to inverseRegex.
Author
Jasper Watson
Details
This function is essentially a wrapper around calling table() on
the return value of inverseRegex. It can be used to identify the indices
of values that consist of a regex pattern different to others in the R object.