Description Usage Arguments Details Value References Examples

For a set of clustering labels, this function computes the comembership of all pairs of observations. Basically, two observations are said to be comembers if they are clustered together.

1 |

`labels` |
a vector of |

Tibshirani and Walther (2005) use the term 'co-membership', which we shorten to 'comembership'. Some authors instead use the terms 'connectivity' or 'co-occurrence'.

We use the `Rcpp`

package to improve the runtime
speed of this function.

a vector of `choose(n, 2)`

comembership bits

Tibshirani, R. and Walther, G. (2005), Cluster Validation by Prediction Strength, _Journal of Computational and Graphical Statistics_, 14, 3, 511-528. http://amstat.tandfonline.com/doi/abs/10.1198/106186005X59243.

1 2 3 4 5 6 7 8 9 10 11 | ```
# We generate K = 3 labels for each of n = 10 observations and compute the
# comembership for all 'n choose 2' pairs.
set.seed(42)
K <- 3
n <- 10
labels <- sample.int(K, n, replace = TRUE)
comembership_out <- comembership(labels)
comembership_out
# Notice that the number of comemberships is 'n choose 2'.
length(comembership_out) == choose(n, 2)
``` |

```
[1] 1 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 1 1 0 0 1 0 0 0 1
[39] 0 0 0 1 0 0 0
[1] TRUE
```

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.