personas_hclust {wpa}R Documentation

Create hierarchical clusters of selected metrics using a Person query

Description

[Questioning]

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.

Usage

personas_hclust(data, metrics, k = 4, return = "plot")

Arguments

data

A data frame containing PersonId and selected metrics for clustering.

metrics

Character vector containing names of metrics to use for clustering. See examples section.

k

Numeric vector to specify the k number of clusters to cut by.

return

String specifying what to return. This must be one of the following strings:

  • "plot"

  • "data"

  • "table"

  • "hclust"

See Value for more information.

Value

A different output is returned depending on the value passed to the return argument:

Author(s)

Ainize Cidoncha ainize.cidoncha@microsoft.com

See Also

Other Clustering: workpatterns_classify(), workpatterns_hclust()

Examples


# 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")



[Package wpa version 1.9.0 Index]