Function detecting inactive periods, i.e. periods of time in which no activity executions/arrivals are recorded in the activity log

detect_inactive_periods(
  activitylog,
  threshold,
  type,
  timestamp,
  start_activities,
  details,
  filter_condition
)

Arguments

activitylog

The activity log

threshold

Threshold after which a period without activity executions/arrivals is considered as an inactive period (expressed in minutes)

type

Type of inactive periods you want to detect. "arrivals" will look for periods without new cases arriving. "activities" will look for periods where no activities occur.

timestamp

Type of timestamp that needs to be taken into account in the analysis (either "start", "complete" or "both)

start_activities

List of activity labels marking the first activity in the process. When specified, an inactive period only occurs when the time between two consecutive arrivals exceeds the specified threshold (arrival is proxied by the activity/activities specified in this argument).

details

Boolean indicating wheter details of the results need to be shown

filter_condition

Condition that is used to extract a subset of the activity log prior to the application of the function

Value

tbl_df providing an overview of the start and end of the inactive periods that have been detected, together with the length of the inactive period

Examples

# \donttest{ data("hospital_actlog") detect_inactive_periods(activitylog = hospital_actlog,threshold = 30)
#> Selected timestamp parameter value: both
#> Selected inactivity type:arrivals
#> *** OUTPUT ***
#> Specified threshold of 30 minutes is violated 9 times.
#> Threshold is violated in the following periods:
#> # A tibble: 9 x 3 #> period_start period_end time_gap #> <dttm> <dttm> <dbl> #> 1 2017-11-20 10:20:06 2017-11-21 11:35:16 1515. #> 2 2017-11-21 11:22:16 2017-11-21 11:59:41 37.4 #> 3 2017-11-21 12:05:52 2017-11-21 13:43:16 97.4 #> 4 2017-11-21 14:06:09 2017-11-21 15:12:17 66.1 #> 5 2017-11-21 15:18:19 2017-11-21 16:42:08 83.8 #> 6 2017-11-21 17:06:10 2017-11-21 18:02:10 56 #> 7 2017-11-21 18:15:04 2017-11-22 10:04:57 950. #> 8 2017-11-22 10:32:56 2017-11-22 16:30:00 357. #> 9 2017-11-22 17:00:00 2017-11-22 18:00:00 60
# }