clusizes {clugenr} | R Documentation |
Cluster sizes are determined using the normal distribution
(\(\mu=\) num_points
\(/\) num_clusters
,
\(\sigma=\mu/3\)), and then assuring that the final cluster sizes
add up to num_points
via the fix_num_points function.
clusizes(num_clusters, num_points, allow_empty)
num_clusters |
Number of clusters. |
num_points |
Total number of points. |
allow_empty |
Allow empty clusters? |
Number of points in each cluster (vector of length num_clusters
).
This function is stochastic. For reproducibility set a PRNG seed with set.seed.
set.seed(123)
sizes <- clusizes(4, 1000, TRUE)
sizes
sum(sizes)