clustApply: Apply a function to each cluster from an hclust object, at a...

Description Usage Arguments Value

View source: R/cluster.r

Description

Apply a function to each cluster from an hclust object, at a given height or with a given number of clusters.

Usage

1
2
clustApply(hclustObject, height = NULL, num_clusters = NULL,
  extraGroupings = NULL, FUN, ...)

Arguments

hclustObject

An hclust object, the result of calling clusterUsers

height

Numeric, indicates the height at which to cut the dendogram and take groups. Must specify either 'height' or 'num_clusters', but not both

num_clusters

Numeric, indicates the number of clusters to use from the heirarchy

extraGroupings

data.frame of the form (user_id, var1, ... varN). The var's are categorical, and are used to split the users into smaller groups.

FUN

A function, one of whose arguments is a set of user_ids.

...

Additional arguments to pass to FUN

Value

A named list of objects, of type value(FUN), one for each cluster in hclustObject, when cut at height 'height'.


johnchower/oneD7 documentation built on May 19, 2019, 4:21 p.m.