Learn R Programming

optpart (version 3.0-3)

disdiam: Dissimilarity Diameters of a Partition

Description

Calculates the diameter (maximum within-cluster dissimilarity) of all clusters in a partition, as well as the average diameter across all clusters.

Usage

disdiam(x,dist,digits)
# S3 method for stride
disdiam(x,dist,digits=3)
# S3 method for disdiam
print(x, …)

Arguments

x

a vector of integers or an object of class ‘clustering’, ‘partition’, ‘partana’, or ‘stride’

dist

an object of class ‘dist’ from dist, dsvdis, or vegdist

digits

the number of significant digits reported in the output

ancillary arguments to the print function

Value

A list with components:

diameters

a data.frame with clusters as rows, and cluster ID, cluster size, and diameter as cols

mean

the weighted mean diameter of clusters of size greater than one. The mean is weighted for cluster size.

Details

disdiam is a cluster validation routine, and calculates the diameter (maximum within-cluster dissimilarity) of each cluster, as well as the average diameter of across all clusters of size greater than one.

Examples

Run this code
# NOT RUN {
data(shoshveg)
dis.bc <- dsvdis(shoshveg,'bray')
opt.5 <- optpart(5,dis.bc)
disdiam(opt.5,dis.bc)
# }

Run the code above in your browser using DataLab