stride {optpart}R Documentation

Stride: Producing a Sequence of Clusterings

Description

stride proceeds along a specified sequence creating clusterings or partitions of a dissimilarity matrix for each value of the sequence.

Usage

stride(seq,arg2,type='pam',numrep=10,maxitr=100)
## S3 method for class 'stride'
plot(x, dist, col2=4, ...)

Arguments

seq

a sequence, in either a:b or seq(a,b,c) form

arg2

an object of class ‘dist’ from dist, dsvdis or vegdist among other sources, or of class ‘hclust’

type

if arg2 is an object of class ‘dist’, type specifies the algorithm to produce clusters, and can be either ‘pam’ or ‘optpart’.

numrep

if arg2 is an object of class ‘dist’ and type = ‘optpart’, numrep specifies the number of replicates to run in function optpart.

maxitr

if arg2 is an object of class ‘dist’ and type = ‘optpart’ numrep specifies the maximum number of iterations per replicate in function optpart

x

an object of class ‘stride’

dist

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

col2

the color code for the second line in the graph

...

ancillary arguments to the plot function

Details

The specific action of function stride depends on the class of the second argument. If arg2 is of class ‘dist’, then clusters are generated by a fixed cluster algorithm. In this case, if type is ‘pam’, the function pam is called to produce the clusters. If type is ‘optpart’ the function optpart is called to produce the clusters. If arg2 is of class ‘hclust’, then the hlcust object is successively ‘sliced’ at levels specified by the sequence. The object of class ‘hclust’ can result from the function hclust using any of the methods provided, or by casting an object of class ‘partition’ to class ‘hlcust’ with the as.hclust function.

The default plot method for a stride plots the partana ratios (see partana) of each partition of the sequence on the left Y axis, and the silhouette widths of the same partitions on the right Y axis.

Value

an object of class ‘stride’, which is a list with components:

clustering

a data.frame with items as rows, and cluster IDs as columns, with one column for each value of the sequence

seq

a copy of the sequence employed

Author(s)

David W. Roberts droberts@montana.edu

Examples

data(shoshveg)
dis.bc <- dsvdis(shoshveg,'bray')
results <- stride(2:5,dis.bc)

[Package optpart version 3.0-3 Index]