ncluster {dbscan} | R Documentation |
Number of Clusters, Noise Points, and Observations
Description
Extract the number of clusters or the number of noise points for
a clustering. This function works with any clustering result that
contains a list element named cluster
with a clustering vector. In
addition, nobs
(see stats::nobs()
) is also available to retrieve
the number of clustered points.
Usage
ncluster(object, ...)
nnoise(object, ...)
Arguments
object |
a clustering result object containing a |
... |
additional arguments are unused. |
Value
returns the number if clusters or noise points.
See Also
Other clustering functions:
dbscan()
,
extractFOSC()
,
hdbscan()
,
jpclust()
,
optics()
,
sNNclust()
Examples
data(iris)
iris <- as.matrix(iris[, 1:4])
res <- dbscan(iris, eps = .7, minPts = 5)
res
ncluster(res)
nnoise(res)
nobs(res)
# the functions also work with kmeans and other clustering algorithms.
cl <- kmeans(iris, centers = 3)
ncluster(cl)
nnoise(cl)
nobs(res)
[Package dbscan version 1.2.2 Index]