Learn R Programming

shallot (version 0.4.8)

association.matrix: Association Matrix

Description

This function creates an association matrix for a clustering/partition. The (i,j) element of the matrix is 1 if item i and j are in the same cluster/subset and 0 otherwise.

Usage

association.matrix(cl)

Arguments

cl

A vector containing cluster labels for a clustering/partition.

Value

A matrix of 0s and 1s indicating whether items i and j are in the same cluster/subset.

Examples

Run this code
# NOT RUN {
cl <- rep(1:3,times=c(2,4,3))
association.matrix(cl)

# }

Run the code above in your browser using DataLab