Learn R Programming

clue (version 0.1-0)

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 object representing a (hard of soft) partition or a hierarchy.

Value

  • An integer giving the number of objects in the clustering.

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 cclust, cluster, e1071, and mclust (and of course, clue itself).

See Also

is.cl_partition, is.cl_hierarchy

Examples

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

Run the code above in your browser using DataLab