randomizePartition {nemBM}R Documentation

Randomize a partition

Description

It randomizes a partition by randomly relocating a given share of units between the clusters. The group sizes are preserved.

Usage

randomizePartition(partition, p, checkSelected = FALSE)

Arguments

partition

Initial partition in a vector format. Each unique value (positive integers) represents one cluster.

p

The share of relocated units.

checkSelected

If TRUE (default is FALSE) a given unit can be relocated only once.

Value

A partition (in a vector format).

Author(s)

Marjan Cugmas and Aleš Žiberna

Examples

randomizePartition(partition = c(1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3), p = 0.3)

[Package nemBM version 1.00.01 Index]