Skip to contents

Trim cases from the first event of a set of start activities to the last event of a set of end activities.

One can trim cases by removing one or more activity instances at the start and/or end of a case. Trimming is performed until all cases have a start and/or end point belonging to a set of allowed activity labels. This filter requires a set of allowed start activities and/or a set of allowed end activities. If one of them is not provided it will not trim the cases at this edge. The selection can be reversed, which means that only the trimmed events at the start and end of cases are retained. As such, this argument allows to cut intermediate parts out of traces.

Usage

filter_trim(
  log,
  start_activities = NULL,
  end_activities = NULL,
  reverse = FALSE,
  eventlog = deprecated()
)

# S3 method for class 'eventlog'
filter_trim(
  log,
  start_activities = NULL,
  end_activities = NULL,
  reverse = FALSE,
  eventlog = deprecated()
)

# S3 method for class 'grouped_eventlog'
filter_trim(
  log,
  start_activities = NULL,
  end_activities = NULL,
  reverse = FALSE,
  eventlog = deprecated()
)

# S3 method for class 'activitylog'
filter_trim(
  log,
  start_activities = NULL,
  end_activities = NULL,
  reverse = FALSE,
  eventlog = deprecated()
)

# S3 method for class 'grouped_activitylog'
filter_trim(
  log,
  start_activities = NULL,
  end_activities = NULL,
  reverse = FALSE,
  eventlog = deprecated()
)

Arguments

log

log: Object of class log or derivatives (grouped_log, eventlog, activitylog, etc.).

start_activities, end_activities

character vector (default NULL): A vector of activity identifiers, or NULL.

reverse

logical (default FALSE): Indicating whether the selection should be reversed.

eventlog

[Deprecated]; please use log instead.

Value

When given an object of type log, it will return a filtered log. When given an object of type grouped_log, the filter will be applied in a stratified way (i.e. each separately for each group). The returned log will be grouped on the same variables as the original log.

Methods (by class)

  • filter_trim(eventlog): Filters activity instances for an eventlog.

  • filter_trim(grouped_eventlog): Filters activity instances for a grouped_eventlog.

  • filter_trim(activitylog): Filters activity instances for an activitylog.

  • filter_trim(grouped_activitylog): Filters activity instances for a grouped_activitylog.

References

Swennen, M. (2018). Using Event Log Knowledge to Support Operational Exellence Techniques (Doctoral dissertation). Hasselt University.