Learn R Programming

optpart (version 3.0-3)

neighbor: Neighbor Analysis of Partitions

Description

Calculates the nearest neighbor (least dissimilar cluster) for each item in partition to identify the topology of the partition.

Usage

neighbor(x,all=FALSE)

Arguments

x

an object of class ‘pam’ or class ‘partana’

all

a logical switch to control which items are included in the calculation

Value

A table with clusters as rows, and neighbors as columns.

Details

Each item in a partition has membership in a cluster. The nearest neighbor of an item is the cluster to which the item is least dissimilar, other than the one to which it it belongs. If ‘all’ is TRUE, then every item is included in the analysis. If ‘all’ is FALSE, only ‘misfits’ are included in the calculation. If the first argument is an object of class ‘pam’, then a misfit is an item with a negative silhouette width (see silhouette). If the first argument is an object of class ‘partana’, a misfit is an item with lower mean dissimilarity to another cluster than to the one to which it belongs.

Examples

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

Run the code above in your browser using DataLab