contains: Contains

View source: R/contains.R

containsR Documentation

Contains

Description

Check if the specified activity is present (contained) in a case.

The contains rule examines whether the supplied activity is present in a case or not. The argument n can be used to set a minimum number of occurences that should be present in each case.

Usage

contains(activity, n = 1)

Arguments

activity

character: The activity to check. This should be an activity of the log supplied to check_rule.

n

numeric (default 1): The minimum number of times the activity should be present. Should be greater than or equal to 1. Use absent instead to check for absent (i.e. n = 0) activities.

See Also

Other Cardinality rules: absent(), contains_between(), contains_exactly()

Examples

library(bupaR)
library(eventdataR)

# Each patient should be registered at least once.
patients %>%
 check_rule(contains("Registration"))

# Check whether some patients have received 2 or more blood tests.
patients %>%
 check_rule(contains("Blood test", n = 2))


processcheckR documentation built on Oct. 3, 2022, 5:05 p.m.