Description Usage Arguments Details Examples

View source: R/collapse_labels.R

Given a matrix of allocations, it performs a permutation on the group labels so that, if `K`

non-empty groups are present, the labels used are exactly {`1, ..., K`

}. Note that the value `z[t,i]=0`

is reserved to the inactive nodes: this transformation leaves such allocations unchanged.

1 | ```
CollapseLabels(allocations)
``` |

`allocations` |
A matrix whose rows identify partitions of the same elements. The entries must be positive integers. Entries equal to zero are interpreted as missing values and hence are left unchanged. |

The labels `{1,...,G}`

of the clustering provided are mapped into `{1,...,K}`

(`K is less or equal than G`

) based on their order of appearance in the matrix provided.

1 2 3 | ```
set.seed(12345)
allocations <- matrix(sample(0:25, 25, TRUE), 5, 5)
CollapseLabels(allocations = allocations)
``` |

GreedySBTM documentation built on May 2, 2019, 12:40 a.m.

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.