extract: Extract A Specific Cluster Solution From A Stride

Description Usage Arguments Details Value Author(s) Examples

View source: R/stride.R

Description

Extracts a specified cluster solution from an object of class ‘stride’. The desired solution is specified by the number of clusters.

Usage

1
2
## S3 method for class 'stride'
extract(stride,k)

Arguments

stride

an object of class ‘stride’ from function stride

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

1
2
3
4
5
6
7
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

optpart documentation built on March 26, 2020, 6:18 p.m.

Related to extract in optpart...