Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

n_of_objects

Number of Objects in a Partition or Hierarchy


Description

Determine the number of objects from which a partition or hierarchy was obtained.

Usage

n_of_objects(x)

Arguments

x

an R object representing a (hard of soft) partition or a hierarchy of objects, or dissimilarities between objects.

Details

This is a generic function.

The methods provided in package clue handle the partitions and hierarchies obtained from clustering functions in the base R distribution, as well as packages RWeka, ape, cba, cclust, cluster, e1071, flexclust, flexmix, kernlab, mclust, movMF and skmeans (and of course, clue itself).

There is also a method for object dissimilarities which inherit from class "dist".

Value

An integer giving the number of objects.

See Also

Examples

data("Cassini")
pcl <- kmeans(Cassini$x, 3)
n_of_objects(pcl)
hcl <- hclust(dist(USArrests))
n_of_objects(hcl)

clue

Cluster Ensembles

v0.3-59
GPL-2
Authors
Kurt Hornik [aut, cre] (<https://orcid.org/0000-0003-4198-9911>), Walter Böhm [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.