Description Usage Arguments Value Examples
View source: R/clusterVariables.R
Computation of a variable clustering on a correlation matrix.
1 | clusterVariables(corMatrix, nbCluster = 1:9)
|
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. |
a dataframe: the first column contains the variable names, the second column the index of the cluster they are affected to.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.