2020-10-27 00:21:24 +03:00
|
|
|
% Generated by roxygen2: do not edit by hand
|
|
|
|
% Please edit documentation in R/workpatterns_hclust.R
|
|
|
|
\name{workpatterns_hclust}
|
|
|
|
\alias{workpatterns_hclust}
|
|
|
|
\title{Create a hierarchical clustering of email or IMs by hour of day}
|
|
|
|
\usage{
|
|
|
|
workpatterns_hclust(
|
|
|
|
data,
|
|
|
|
k = 4,
|
|
|
|
return = "plot",
|
|
|
|
values = "percent",
|
|
|
|
signals = "email",
|
|
|
|
start_hour = "0900",
|
|
|
|
end_hour = "1700"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
\arguments{
|
|
|
|
\item{data}{A data frame containing data from the Hourly Collaboration query.}
|
|
|
|
|
|
|
|
\item{k}{Numeric vector to specify the \code{k} number of clusters to cut by.}
|
|
|
|
|
|
|
|
\item{return}{Character vector to specify what to return.
|
|
|
|
Valid options include "plot" (default), "data", "table", "plot-area", "hclust", and "dist".
|
|
|
|
"plot" returns a bar plot, whilst "plot-area" returns an overlapping area plot.
|
|
|
|
"hclust" returns the hierarchical model generated by the function.
|
|
|
|
"dist" returns the distance matrix used to build the clustering model.}
|
|
|
|
|
|
|
|
\item{values}{Character vector to specify whether to return percentages
|
|
|
|
or absolute values in "data" and "plot". Valid values are "percent" (default)
|
|
|
|
and "abs".}
|
|
|
|
|
|
|
|
\item{signals}{Character vector to specify which collaboration metrics to use:
|
|
|
|
You may use "email" (default) for emails only, "IM" for Teams messages only,
|
2020-11-27 17:04:40 +03:00
|
|
|
"unscheduled_calls" for Unscheduled Calls only, or a combination, such as \code{c("email", "IM")}.}
|
2020-10-27 00:21:24 +03:00
|
|
|
|
|
|
|
\item{start_hour}{A character vector specifying starting hours,
|
|
|
|
e.g. "0900"}
|
|
|
|
|
|
|
|
\item{end_hour}{A character vector specifying starting hours,
|
|
|
|
e.g. "1700"}
|
|
|
|
}
|
|
|
|
\value{
|
|
|
|
The summary table returned by \code{return == "table"} represent percentiles of signals,
|
|
|
|
e.g. x\% of signals are sent by y hour of the day.
|
|
|
|
}
|
|
|
|
\description{
|
2021-01-21 21:25:04 +03:00
|
|
|
\Sexpr[results=rd]{lifecycle::badge("experimental")}
|
2020-10-27 00:21:24 +03:00
|
|
|
Apply hierarchical clustering to emails sent by hour of day.
|
|
|
|
The hierarchical clustering uses cosine distance and the ward.D method
|
|
|
|
of agglomeration.
|
|
|
|
}
|
|
|
|
\details{
|
|
|
|
The hierarchical clustering is applied on the person-average volume-based (pav) level.
|
|
|
|
In other words, the clustering is applied on a dataset where the collaboration hours
|
|
|
|
are averaged by person and calculated as \% of total daily collaboration.
|
|
|
|
}
|
|
|
|
\examples{
|
2021-01-15 20:54:56 +03:00
|
|
|
## Run clusters, returning plot
|
|
|
|
workpatterns_hclust(em_data, k = 5, return = "plot")
|
|
|
|
|
|
|
|
## Run clusters, return raw data
|
|
|
|
workpatterns_hclust(em_data, k = 4, return = "data")
|
|
|
|
|
|
|
|
## Run clusters for instant messages only, return hclust object
|
|
|
|
workpatterns_hclust(em_data, k = 4, return = "hclust", signals = c("IM"))
|
|
|
|
|
2020-10-27 00:21:24 +03:00
|
|
|
\dontrun{
|
2021-01-15 20:54:56 +03:00
|
|
|
## Run clusters with all three signal types, return plot
|
2020-11-27 17:04:40 +03:00
|
|
|
workpatterns_hclust(em_data,
|
|
|
|
k = 4,
|
|
|
|
return = "plot",
|
|
|
|
signals = c("IM", "email", "unscheduled_calls"))
|
2020-10-27 00:21:24 +03:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
\seealso{
|
|
|
|
Other Work Patterns:
|
|
|
|
\code{\link{personas_hclust}()},
|
|
|
|
\code{\link{workpatterns_area}()}
|
|
|
|
}
|
|
|
|
\concept{Work Patterns}
|