extract {optpart} | R Documentation |
Extracts a specified cluster solution from an object of class ‘stride’. The desired solution is specified by the number of clusters.
## S3 method for class 'stride'
extract(stride,k)
stride |
an object of class ‘stride’ from function
|
k |
the number of clusters desired |
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’.
an object of class ‘clustering’.
David W. Roberts droberts@montana.edu
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