check_rule: Check declarative rules.

Description Usage Arguments Value Examples

View source: R/check_rule.R

Description

This function can be used to check rules on event data. It needs an event log and a rule. Rules can be made with the following functions: absent(), and(), contains(), contains_between(), contains_exactly(), ends(), precedence(), response(), responded_existence(), starts(), succession(), xor().

Usage

1
check_rule(eventlog, rule, label = NULL)

Arguments

eventlog

Eventlog object

rule

A rule create by a rule function.

label

Optionally, the variable name under which the result of the rule should be stored.

Value

An annotated event log, where a new column indicates whether the rule holds or not. The name of the new column can optionally be set using the "label" argument.

Examples

1
2
3
4
5
6
library(bupaR)
library(eventdataR)

# check whether MRI Scan is preceded by Blood test.
patients %>%
check_rule(precedence("Blood test","MRI SCAN"))

gertjanssenswillen/processcheckR documentation built on July 31, 2019, 9:34 a.m.