View source: R/personas_hclust.R
personas_hclust | R Documentation |
Apply hierarchical clustering to selected metrics. Person averages are computed prior to clustering. The hierarchical clustering uses cosine distance and the ward.D method of agglomeration.
personas_hclust(data, metrics, k = 4, return = "plot")
data |
A data frame containing |
metrics |
Character vector containing names of metrics to use for clustering. See examples section. |
k |
Numeric vector to specify the |
return |
String specifying what to return. This must be one of the following strings:
See |
A different output is returned depending on the value passed to the return
argument:
"plot"
: 'ggplot' object. A heatmap plot comparing the key metric averages
of the clusters as per keymetrics_scan()
.
"data"
: data frame. Raw data with clusters appended
"table"
: data frame. Summary table for identified clusters
"hclust"
: 'hclust' object. hierarchical model generated by the function.
Ainize Cidoncha ainize.cidoncha@microsoft.com
Other Clustering:
workpatterns_classify()
,
workpatterns_hclust()
# Return plot
personas_hclust(sq_data,
metrics = c("Collaboration_hours", "Workweek_span"),
k = 4)
# Return summary table
personas_hclust(sq_data,
metrics = c("Collaboration_hours", "Workweek_span"),
k = 4,
return = "table")
# Return data with clusters appended
personas_hclust(sq_data,
metrics = c("Collaboration_hours", "Workweek_span"),
k = 4,
return = "data")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.