cluster2keys | R Documentation |

The output of the kmeans clustering function produces a vector of cluster membership. The `score.items`

and `cluster.cor`

functions require a matrix of keys. cluster2keys does this.

May also be used to take the output of an `ICLUST`

analysis and find a keys matrix. (By doing a call to the `factor2cluster`

function.

```
cluster2keys(c)
```

`c` |
A vector of cluster assignments or an object of class â€œkmeans" that contains a vector of clusters. |

Note that because kmeans will not reverse score items, the clusters defined by kmeans will not necessarily match those of ICLUST with the same number of clusters extracted.

`keys` |
A matrix of keys suitable for score.items or cluster.cor |

William Revelle

`cluster.cor`

,`score.items`

, `factor2cluster`

, `make.keys`

```
test.data <- Harman74.cor$cov
kc <- kmeans(test.data,4)
keys <- cluster2keys(kc)
keys #these match those found by ICLUST
cluster.cor(keys,test.data)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.