splitClu {blockmodeling}R Documentation

Functions creating a list of partitions based on a single partition and information on the number of units in each set.

Description

Function splitClu creates a list of partitions based on a single partition (clu) and information on the number of units in each set (n).

Function splitCluRes does the same but extracts the information from the result of (old versions of) functions critFunC, optParC, optRandomParC or similar (newer versions should already return a list of partitions in case they are used on networks with more sets of units.

Usage

splitClu(clu, n, renumber = FALSE)

splitCluRes(res, renumber = FALSE)

Arguments

clu

A vector representing a partition of units from different sets. Result of some legacy code for optRandomParC or optParC or similar functions.

n

A vector with number of units per set. The assuption is that the first n[1] elements of clu are for the first set, the second n[2] elements of clu are for the second set and so on. sum(n) must be equal to length(clu).

renumber

If TRUE (default), dimensions that have only one level are dropped (drop function is applied to the final result).

res

Result of (old versions of) functions critFunC, optParC, optRandomParC or similar.

Value

A list of partitions if clu, one for each set of units. A single vector if only one set of units is present.

Author(s)

Aleš Žiberna

See Also

clu

Examples

n <- c(8,8) 
clu <- c(rep(1:2, times = c(3, 5)), rep(3:4, times = c(3, 5)))
splitClu(clu = clu, n = n )
splitClu(clu = clu, n = n, renumber = TRUE)
 

[Package blockmodeling version 1.0.5 Index]