Check if the specified activity is present (contained) in a case between the minimum and maximum number of times.
The contains_between rule examines whether the supplied activity is present in a case for a certain interval of times.
The arguments min and max can be used to specify the allowed interval of occurences.
Usage
contains_between(activity, min = 1, max = 1)
Arguments
activity
character: The activity to check. This should be an activity of the log supplied to check_rule.
min
numeric (default 1): The minimum number of times the activity should be present (inclusive).
Should be greater than or equal to 0.
max
numeric (default 1): The maximum number of times the activity should be present (inclusive).
Should be greater than or equal to min.
See Also
Other Cardinality rules:
absent(),
contains_exactly(),
contains()
library(bupaR)
library(eventdataR)
# A patients should have between 0 and 4 blood tests (including 0 and 4).patients %>%
check_rule(contains_between("Blood test", min = 0, max = 4))