wpa/man/workpatterns_hclust.Rd

114 строки
3.6 KiB
Plaintext
Исходник Обычный вид История

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.}
2021-02-26 21:31:45 +03:00
\item{return}{String specifying what to return. This must be one of the
following strings:
2021-02-03 19:53:54 +03:00
\itemize{
2021-02-26 21:31:45 +03:00
\item \code{"plot"}
\item \code{"data"}
\item \code{"table"}
\item \code{"plot-area"}
\item \code{"hclust"}
\item \code{"dist"}
}
See \code{Value} for more information.}
2020-10-27 00:21:24 +03:00
\item{values}{Character vector to specify whether to return percentages
2021-02-03 19:53:54 +03:00
or absolute values in "data" and "plot". Valid values are:
\itemize{
\item "percent": percentage of signals divided by total signals (default)
\item "abs": absolute count of signals
}}
2020-10-27 00:21:24 +03:00
\item{signals}{Character vector to specify which collaboration metrics to use:
2021-02-02 17:59:32 +03:00
\itemize{
2021-02-26 21:26:06 +03:00
\item \code{"email"} (default) for emails only
\item \code{"IM"} for Teams messages only
\item \code{"unscheduled_calls"} for Unscheduled Calls only
\item \code{"meetings"} for Meetings only
2021-02-02 17:59:32 +03:00
\item or a combination of signals, 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{
2021-02-26 21:31:45 +03:00
A different output is returned depending on the value passed to the \code{return}
argument:
\itemize{
\item \code{"plot"}: ggplot object of a bar plot (default)
\item \code{"data"}: data frame containing raw data with the clusters
\item \code{"table"}: data frame containing a summary table. Percentages of signals
are shown, e.g. x\% of signals are sent by y hour of the day.
\item \code{"plot-area"}: ggplot object. An overlapping area plot
\item \code{"hclust"}: \code{hclust} object for the hierarchical model
\item \code{"dist"}: distance matrix used to build the clustering model
}
2020-10-27 00:21:24 +03:00
}
\description{
2021-03-18 14:28:40 +03:00
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}}
2021-03-02 03:13:50 +03:00
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{
# Run clusters, returning plot
2021-01-15 20:54:56 +03:00
workpatterns_hclust(em_data, k = 5, return = "plot")
# Run clusters, return raw data
2021-02-26 21:26:06 +03:00
workpatterns_hclust(em_data, k = 4, return = "data") \%>\% head()
2021-01-15 20:54:56 +03:00
# Run clusters for instant messages only, return hclust object
2021-01-15 20:54:56 +03:00
workpatterns_hclust(em_data, k = 4, return = "hclust", signals = c("IM"))
2020-10-27 00:21:24 +03:00
}
\seealso{
Other Clustering:
\code{\link{personas_hclust}()},
\code{\link{workpatterns_classify}()}
2021-03-05 01:19:07 +03:00
Other Working Patterns:
2021-01-27 19:16:08 +03:00
\code{\link{flex_index}()},
\code{\link{identify_shifts_wp}()},
\code{\link{identify_shifts}()},
2021-01-27 19:16:08 +03:00
\code{\link{plot_flex_index}()},
\code{\link{workpatterns_area}()},
\code{\link{workpatterns_classify_bw}()},
\code{\link{workpatterns_classify_pav}()},
\code{\link{workpatterns_classify}()},
\code{\link{workpatterns_rank}()},
\code{\link{workpatterns_report}()}
2020-10-27 00:21:24 +03:00
}
\concept{Clustering}
2021-03-05 01:19:07 +03:00
\concept{Working Patterns}