| fix_num_points | R Documentation |
Certifies that the values in the clu_num_points array, i.e. the number of
points in each cluster, add up to num_points. If this is not the case, the
clu_num_points array is modified in-place, incrementing the value
corresponding to the smallest cluster while
sum(clu_num_points) < num_points, or decrementing the value corresponding
to the largest cluster while sum(clu_num_points) > num_points.
fix_num_points(clu_num_points, num_points)
clu_num_points |
Number of points in each cluster (vector of size \mjseqnc), where \mjseqnc is the number of clusters. |
num_points |
The expected total number of points. |
This function is used internally by clusizes and might be useful for
custom cluster sizing implementations given as the clusizes_fn parameter of
the main clugen function.
Number of points in each cluster, after being fixed by this function.
clusters <- c(1, 6, 3) # 10 total points
clusters <- fix_num_points(clusters, 12) # But we want 12 total points
clusters # Check that we now have 12 points
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.