extract {optpart} | R Documentation |
Extract A Specific Cluster Solution From A Stride
Description
Extracts a specified cluster solution from an object of class ‘stride’. The desired solution is specified by the number of clusters.
Usage
## S3 method for class 'stride'
extract(stride,k)
Arguments
stride |
an object of class ‘stride’ from function
|
k |
the number of clusters desired |
Details
A stride object consists of a list with a data.frame of cluster solutions for varying numbers of clusters. Extract simply selects one column of this data.frame (specified by number of clusters desired, not column number) and returns that solution as an object of class ‘clustering’.
Value
an object of class ‘clustering’.
Author(s)
David W. Roberts droberts@montana.edu
Examples
data(shoshveg) # get vegetation data
dis.bc <- dsvdis(shoshveg,'bray') # calculate dissimilarity
# matrix
avg.hcl <- hclust(dis.bc,'average') # average linkage cluster
# analysis
avg.2.10 <- stride(2:10,avg.hcl) # compute stride
res <- extract(avg.2.10,8) # extract 8-cluster solution
[Package optpart version 3.0-3 Index]