AgnesParam-class | R Documentation |
Run the agnes
function on a distance matrix within clusterRows
.
AgnesParam(
metric = NULL,
stand = NULL,
method = NULL,
par.method = NULL,
cut.fun = NULL,
cut.dynamic = FALSE,
cut.params = list()
)
## S4 method for signature 'ANY,AgnesParam'
clusterRows(x, BLUSPARAM, full = FALSE)
metric , stand , method , par.method |
Further arguments to pass to |
cut.fun |
Function specifying the method to use to cut the dendrogram.
The first argument of this function should be the output of |
cut.dynamic |
Logical scalar indicating whether a dynamic tree cut should be performed using the dynamicTreeCut package. |
cut.params |
Further arguments to pass to |
x |
A numeric matrix-like object where rows represent observations and columns represent variables. |
BLUSPARAM |
A HclustParam object. |
full |
Logical scalar indicating whether the hierarchical clustering statistics should be returned. |
To modify an existing AgnesParam object x
,
users can simply call x[[i]]
or x[[i]] <- value
where i
is any argument used in the constructor.
If cut.fun=NULL
, cut.dynamic=FALSE
and cut.params
does not have h
or k
,
clusterRows
will automatically set h
to half the tree height when calling cutree
.
The AgnesParam
constructor will return a AgnesParam object with the specified parameters.
The clusterRows
method will return a factor of length equal to nrow(x)
containing the cluster assignments.
If full=TRUE
, a list is returned with clusters
(the factor, as above) and objects
(a list containing agnes
, the function output; dist
, the dissimilarity matrix; and hclust
, a hclust object created from agnes
).
Aaron Lun
agnes
, which actually does all the heavy lifting.
HclustParam, for the more commonly used implementation of hierarchical clustering.
clusterRows(iris[,1:4], AgnesParam())
clusterRows(iris[,1:4], AgnesParam(method="ward"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.