clusterVariables: Variable clustering (using Normal Mixture Modeling for...

Description Usage Arguments Value Examples

View source: R/clusterVariables.R

Description

Computation of a variable clustering on a correlation matrix.

Usage

1
clusterVariables(corMatrix, nbCluster = 1:9)

Arguments

corMatrix

a dataframe corresponding to a correlation matrix

nbCluster

an integer or a vector of integers corresponding to the preferred number of cluster for the unsupervised learning.

Value

a dataframe: the first column contains the variable names, the second column the index of the cluster they are affected to.

Examples

1
2
3
4
5
6
7
8
# calculate a correlation dataframe
data(iris)
corDF <- multiBivariateCorrelation(dataset = iris, corMethods = "MaxNMI")
# tranform to correlation matrix
corMatrix <- corCouplesToMatrix(x1_x2_val = corDF[,c('X1','X2',"MaxNMI")])
# perform the clustering
corGroups <- clusterVariables(corMatrix = corMatrix, nbCluster = 3)
print(corGroups)

linkspotter documentation built on July 23, 2020, 5:08 p.m.