varclust: Clustering of numeric variables

Description Usage Arguments Details Value Author(s) Examples

View source: R/varclust.R

Description

The function clusters variables using the average linkage algorithm.

Usage

1
varclust(data, c = NULL, mincor = NULL)

Arguments

data

A data frame.

c

A positive integer. The number of clusters.

mincor

Numeric. The minimal correlation within each of the single clusters.

Details

The number of clusters can be set by specifying c or choosing mincor (but not both at the same time). If mincor is used, the number of clusters is defined by a minimum correlation. That means every single pair of variables in the individual clusters is correlated with a value which is at least mincor.

Value

A list with the following object:

c

The number of clusters.

mincor

The minimal correlation within each of the single clusters.

clusters

The cluster allocation for each variable.

clusrep

A character vector indicating the variables which are used as representatives for the clusters.

dfclusrep

A data frame which only holds the cluster representatives as variables.

Author(s)

Katrin Grimm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(Election2005)
## Not run: 
# Variable clustering based on minimum correlation
vc1 <- varclust(Election2005,mincor=0.8)
vc1$c # The number of clusters is 45

# Variable clustering based on the number of clusters
vc2 <- varclust(Election2005,30)
vc2$mincor # The minimum correlation is 0.63

## End(Not run)

mbgraphic documentation built on May 2, 2019, 2:45 a.m.