clusterVariables {linkspotter} | R Documentation |
Variable clustering (using Normal Mixture Modeling for Model-Based Clustering : mclust)
Description
Computation of a variable clustering on a correlation matrix.
Usage
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
# 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)
[Package linkspotter version 1.3.0 Index]