bupaverse / edeaR

Exploratory and descriptive analysis of event based data.
https://bupaverse.github.io/edeaR/
Other
12 stars 3 forks source link

The filter_precedence() function fails when activity labels contain parentheses. #1

Closed sempeelman closed 5 years ago

sempeelman commented 5 years ago

The filter_precedence functions fails when activity labels contain parentheses.

Below is a minimal example where the filter is expected to return the entire event log:

library(lubridate)
library(bupaR)
library(edeaR)

events <- data.frame(
  case = c(1, 1),
  timestamp = c(as_datetime("2018-01-01 12:00:00"), as_datetime("2018-02-01 12:00:00")),
  activity = c("first event (1)", "second event (2)"),
  activity_instance = c(1, 2),
  status = c("complete", "complete"),
  resource = c("me", "you")
)

event_log <- events %>%
  eventlog(
    case_id = "case",
    timestamp = "timestamp",
    activity_id = "activity",
    activity_instance_id = "activity_instance",
    lifecycle_id = "status",
    resource_id = "resource"
  )

event_log %>%
  filter_precedence(antecedents = "first event (1)",
                    consequents = "second event (2)")
gertjanssenswillen commented 5 years ago

Parenthesis were ignored because patterns were interpreted as regular expressions. Now they are fixed. Fixed in dev branch.