% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/clustering.R
\name{immunr_hclust}
\alias{immunr_hclust}
\alias{immunr_kmeans}
\alias{immunr_dbscan}
\title{Clustering of objects or distance matrices}
\usage{
immunr_hclust(.data, .k = 2, .k.max = nrow(.data) - 1, .method = "complete", .dist = TRUE)

immunr_kmeans(.data, .k = 2, .k.max = as.integer(sqrt(nrow(.data))) + 1,
.method = c("silhouette", "gap_stat"))

immunr_dbscan(.data, .eps, .dist = TRUE)
}
\arguments{
\item{.data}{Matrix or data frame with features, distance matrix or output from \link{repOverlapAnalysis} or \link{geneUsageAnalysis} functions.}

\item{.k}{The number of clusters to create, passed as \code{k} to \link[factoextra]{hcut} or as \code{centers} to \link{kmeans}.}

\item{.k.max}{Limits the maximum number of clusters. It is passed as \code{k.max} to \link{fviz_nbclust} for \code{immunr_hclust} and \code{immunr_kmeans}.}

\item{.method}{Passed to \link[factoextra]{hcut} or as \link{fviz_nbclust}.

In case of \link[factoextra]{hcut} the agglomeration method is going to be used (argument \code{hc_method}).

In case of \link{fviz_nbclust} it is the method to be used for estimating the optimal number of clusters (argument \code{method}).}

\item{.dist}{If TRUE then ".data" is expected to be a distance matrix. If FALSE then the euclidean distance is computed for the input objects.}

\item{.eps}{Local radius for expanding clusters, minimal distance between points to expand clusters. Passed as \code{eps} to \link[fpc]{dbscan}.}
}
\value{
\code{immunr_hclust} - list with two elements. First element is an output from \link{hcut}.
Second element is an output from \link{fviz_nbclust}

\code{immunr_kmeans} - list with three elements. First element is an output from \link{kmeans}.
Second element is an output from \link{fviz_nbclust}.
Third element is the input dataset \code{.data}.

\code{immunr_dbscan} - list with two elements. First element is an output from \link{dbscan}.
Second element is the input dataset \code{.data}.
}
\description{
Cluster the data with one of the following methods:

- \code{immunr_hclust} clusters the data using the hierarchical clustering from \link[factoextra]{hcut};

- \code{immunr_kmeans} clusters the data using the K-means algorithm from \link{kmeans};

- \code{immunr_dbscan} clusters the data using the DBSCAN algorithm from \link[fpc]{dbscan}.
}
\examples{
data(immdata)
gu <- geneUsage(immdata$data, .norm = TRUE)
immunr_hclust(t(as.matrix(gu[, -1])), .dist = FALSE)

gu[is.na(gu)] <- 0
immunr_kmeans(t(as.matrix(gu[, -1])))
}
\concept{post_analysis}
