Description Usage Arguments Value Examples
Function to calculate the similarity matrix based on the cluster membership indicator of each iteration.
1 | calSim(mat)
|
mat |
A matrix of cluster membership indicators. |
returns a similarity matrix.
1 2 3 4 5 6 7 8 9 10 11 | n = 90 ## number of subjects
iters = 200 ## number of iterations
## matrix of cluster membership indicators
## perfect clustering with three clusters
mat = matrix(rep(1:3,each=n/3),nrow=n,ncol=iters)
sim = calSim(t(mat))
## plot similarity matrix
x <- rep(1:n,times=n)
y <- rep(1:n,each=n)
z <- as.vector(sim)
levelplot(z~x*y,col.regions=rev(gray.colors(n^2)), xlab = "Subject ID",ylab = "Subject ID")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.