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"))
Hourly Collaboration query containing signal variables (e.g.
Emails_sent_00_01
)
Numeric value between 0 to 23 to iterate through
Character vector for specifying which signal types to combine.
Defaults to c("Emails_sent", "IMs_sent")
. Other valid values include
"Unscheduled_calls"
and "Meetings"
.
Returns a numeric vector that represents the sum of signals sent for a given hour.
combine_signals
uses string matching to aggregate columns.
Other Support:
camel_clean()
,
check_inputs()
,
cut_hour()
,
extract_date_range()
,
extract_hr()
,
heat_colours()
,
is_date_format()
,
maxmin()
,
p_test()
,
pairwise_count()
,
plot_WOE()
,
read_preamble()
,
rgb2hex()
,
totals_bind()
,
totals_col()
,
totals_reorder()
,
tstamp()
,
us_to_space()
,
wrap()
# 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