powered by
It randomizes a partition by randomly relocating a given share of units between the clusters. The group sizes are preserved.
randomizePartition(partition, p, checkSelected = FALSE)
A partition (in a vector format).
Initial partition in a vector format. Each unique value (positive integers) represents one cluster.
The share of relocated units.
If TRUE (default is FALSE) a given unit can be relocated only once.
TRUE
FALSE
Marjan Cugmas and Aleš Žiberna
randomizePartition(partition = c(1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3), p = 0.3)
Run the code above in your browser using DataLab