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 eventlog
filter_trim(
log,
start_activities = NULL,
end_activities = NULL,
reverse = FALSE,
eventlog = deprecated()
)

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

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

# S3 method for 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

; 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.

Other filters: filter_activity_frequency(), filter_activity_instance(), filter_activity_presence(), filter_activity(), filter_case_condition(), filter_case(), filter_endpoints_condition(), filter_endpoints(), filter_flow_time(), filter_idle_time(), filter_infrequent_flows(), filter_lifecycle_presence(), filter_lifecycle(), filter_precedence_condition(), filter_precedence_resource(), filter_precedence(), filter_processing_time(), filter_resource_frequency(), filter_resource(), filter_throughput_time(), filter_time_period(), filter_trace_frequency(), filter_trace_length(), filter_trace(), filter_trim_lifecycle()