clusizes | R Documentation |
Cluster sizes are determined using the normal distribution
(\mjeqn\mu=μ= num_points
\mjseqn/ num_clusters
,
\mjeqn\sigma=\mu/3σ=μ/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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.