% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AgnesParam.R
\docType{class}
\name{AgnesParam-class}
\alias{AgnesParam-class}
\alias{show,AgnesParam-method}
\alias{.defaultScalarArguments,AgnesParam-method}
\alias{AgnesParam}
\alias{clusterRows,ANY,AgnesParam-method}
\title{Agglomerative nesting}
\usage{
AgnesParam(
  metric = NULL,
  stand = NULL,
  method = NULL,
  par.method = NULL,
  cut.fun = NULL,
  cut.dynamic = FALSE,
  cut.params = list()
)

\S4method{clusterRows}{ANY,AgnesParam}(x, BLUSPARAM, full = FALSE)
}
\arguments{
\item{metric, stand, method, par.method}{Further arguments to pass to \code{\link{agnes}}.}

\item{cut.fun}{Function specifying the method to use to cut the dendrogram.
The first argument of this function should be the output of \code{\link{hclust}},
and the return value should be an atomic vector specifying the cluster assignment for each observation.
Defaults to \code{\link{cutree}} if \code{cut.dynamic=FALSE} and \code{\link[dynamicTreeCut]{cutreeDynamic}} otherwise.}

\item{cut.dynamic}{Logical scalar indicating whether a dynamic tree cut should be performed using the \pkg{dynamicTreeCut} package.}

\item{cut.params}{Further arguments to pass to \code{cut.fun}.}

\item{x}{A numeric matrix-like object where rows represent observations and columns represent variables.}

\item{BLUSPARAM}{A \linkS4class{HclustParam} object.}

\item{full}{Logical scalar indicating whether the hierarchical clustering statistics should be returned.}
}
\value{
The \code{AgnesParam} constructor will return a \linkS4class{AgnesParam} object with the specified parameters.

The \code{clusterRows} method will return a factor of length equal to \code{nrow(x)} containing the cluster assignments.
If \code{full=TRUE}, a list is returned with \code{clusters} (the factor, as above) and \code{objects}
(a list containing \code{agnes}, the function output; \code{dist}, the dissimilarity matrix; and \code{hclust}, a \link{hclust} object created from \code{agnes}).
}
\description{
Run the \code{\link{agnes}} function on a distance matrix within \code{\link{clusterRows}}.
}
\details{
To modify an existing AgnesParam object \code{x},
users can simply call \code{x[[i]]} or \code{x[[i]] <- value} where \code{i} is any argument used in the constructor.

If \code{cut.fun=NULL}, \code{cut.dynamic=FALSE} and \code{cut.params} does not have \code{h} or \code{k},
\code{\link{clusterRows}} will automatically set \code{h} to half the tree height when calling \code{\link{cutree}}.
}
\examples{
clusterRows(iris[,1:4], AgnesParam())
clusterRows(iris[,1:4], AgnesParam(method="ward"))

}
\seealso{
\code{\link{agnes}}, which actually does all the heavy lifting.

\linkS4class{HclustParam}, for the more commonly used implementation of hierarchical clustering.
}
\author{
Aaron Lun
}
