Takes in an Hourly Collaboration Data, and for each hour sums and aggregates the signals (e.g.Emails_sent and IMs_sent) in Signals_sent. This is an internal function used in the Working Patterns functions.

combine_signals(data, hr, signals = c("Emails_sent", "IMs_sent"))

Arguments

data

Hourly Collaboration query containing signal variables (e.g. Emails_sent_00_01)

hr

Numeric value between 0 to 23 to iterate through

signals

Character vector for specifying which signal types to combine. Defaults to c("Emails_sent", "IMs_sent"). Other valid values include "Unscheduled_calls" and "Meetings".

Value

Returns a numeric vector that represents the sum of signals sent for a given hour.

Details

combine_signals uses string matching to aggregate columns.

Examples

# Demo using simulated variables
sim_data <-
  data.frame(Emails_sent_09_10 = sample(1:5, size = 10, replace = TRUE),
             Unscheduled_calls_09_10 = sample(1:5, size = 10, replace = TRUE))

combine_signals(sim_data, hr = 9, signals = c("Emails_sent", "Unscheduled_calls"))
#>    Signals_sent_09_10
#> 1                   3
#> 2                   7
#> 3                   7
#> 4                  10
#> 5                   8
#> 6                   5
#> 7                   6
#> 8                   6
#> 9                   3
#> 10                  8