This function uses outlook calendar settings for start and end time of work day to identify work shifts. The relevant variables are WorkingStartTimeSetInOutlook and WorkingEndTimeSetInOutlook.

identify_shifts(data, return = "plot")

Arguments

data

A data frame containing data from the Hourly Collaboration query.

return

String specifying what to return. This must be one of the following strings:

  • "plot"

  • "table"

  • "data"

See Value for more information.

Value

A different output is returned depending on the value passed to the return

argument:

  • "plot": ggplot object. A bar plot for the weekly count of shifts.

  • "table": data frame. A summary table for the count of shifts.

  • "data: data frame. Input data appended with the Shifts columns.

Examples

# Return plot
dv_data %>% identify_shifts()


# Return summary table
dv_data %>% identify_shifts(return = "table")
#> # A tibble: 2 × 3
#>   Shifts      WeekCount PersonCount
#>   <chr>           <int>       <int>
#> 1 07:00-23:00       832          64
#> 2 06:00-18:00        45           5