Apply a rule based algorithm to emails or instant messages sent by hour of day. Uses a binary week-based ('bw') method by default, with options to use the the person-average volume-based ('pav') method.
workpatterns_classify(
data,
hrvar = "Organization",
values = "percent",
signals = "email",
start_hour = "0900",
end_hour = "1700",
active_threshold = 0,
method = "bw",
return = "plot"
)
A data frame containing data from the Hourly Collaboration query.
A string specifying the HR attribute to cut the data by. Defaults to NULL. This only affects the function when "table" is returned, and is only applicable for method = "bw".
Only valid if using pav
method. Character vector to specify
whether to return percentages or absolute values in "data" and "plot".
Valid values are "percent" (default) and "abs".
Character vector to specify which collaboration metrics to use:
"email"
(default) for emails only
"IM"
for Teams messages only
"unscheduled_calls"
for Unscheduled Calls only
"meetings"
for Meetings only
or a combination of signals, such as c("email", "IM")
A character vector specifying starting hours, e.g. "0900". Note that this currently only supports hourly increments.
A character vector specifying starting hours, e.g. "1700". Note that this currently only supports hourly increments.
A numeric value specifying the minimum number of signals to be greater than in order to qualify as active. Defaults to 0. Only applicable for the binary-week method.
String to pass through specifying which method to use for classification. By default, a binary week-based (bw) method is used, with options to use the the person-average volume-based (pav) method.
String specifying what to return. This must be one of the following strings:
"plot"
"data"
"table"
"plot-area"
See Value
for more information.
Character vector to specify what to return. Valid options include:
"plot"
: returns a heatmap plot of signal distribution by hour
and archetypes (default)
"data"
: returns the raw data with the classified archetypes
"table"
: returns a summary table of the archetypes
"plot-area"
: returns an area plot of the percentages of archetypes
shown over time
This method classifies each person-week into one of the seven archetypes:
0 < 3 hours on
1 Standard with breaks workday
2 Standard continuous workday
3 Standard flexible workday
4 Long flexible workday
5 Long continuous workday
6 Always on (13h+)
This is the recommended method over pav
for several reasons:
bw
ignores volume effects, where activity volume can still bias the
results towards the 'standard working hours'.
It captures the intuition that each individual can have 'light' and 'heavy' weeks with respect to workload.
This method classifies each person (based on unique PersonId
) into
one of the six archetypes:
Absent
Extended Hours - Morning
Extended Hours - Evening
Overnight workers
Standard Hours
Always On
The Working Patterns archetypes as calculated
using the binary-week method shares many similarities with the Flexibility
Index (see flex_index()
): - Both are computed directly from the Hourly
Collaboration Flexible Query. - Both apply the same binary conversion of
activity on the signals from the Hourly Collaboration Flexible Query.
This is a wrapper around workpatterns_classify_bw()
and
workpatterns_classify_pav()
, and calls each function depending on what is
supplied to the method
argument. Both methods implement a rule-based
classification of either person-weeks or persons that pull apart
different working patterns.
See individual sections below for details on the two different implementations.
Other Clustering:
personas_hclust()
,
workpatterns_hclust()
Other Working Patterns:
flex_index()
,
identify_shifts_wp()
,
identify_shifts()
,
plot_flex_index()
,
workpatterns_area()
,
workpatterns_classify_bw()
,
workpatterns_classify_pav()
,
workpatterns_hclust()
,
workpatterns_rank()
,
workpatterns_report()
# NOT RUN {
# Returns a plot by default
em_data %>% workpatterns_classify(method = "bw")
# Return an area plot
em_data %>% workpatterns_classify(method = "bw", return = "plot-area")
# }
# NOT RUN {
em_data %>% workpatterns_classify(method = "bw", return = "table")
em_data %>% workpatterns_classify(method = "pav")
em_data %>% workpatterns_classify(method = "pav", return = "plot-area")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab