R/method_split.R
method_split.RdThese functions split a continuous score, such as a coreness score, into an ordered set of groups:
split_bins() cuts the range into equal-width bins.
split_quantiles() cuts at the quantiles, so each group holds a
similar number of nodes.
split_kmeans() clusters the scores by k-means, so the cuts fall
where the scores themselves are furthest apart.
These functions are not intended to be called directly,
but are called within node_in_core() and related functions.
They are exported and listed here to provide more detailed documentation.
split_bins(scores, groups)
split_quantiles(scores, groups)
split_kmeans(scores, groups)An integer vector the length of scores,
giving each score's group index, numbered from the lowest score upwards.
Cuts the observed range into groups intervals of equal width.
Where the scores are unevenly spread, a bin can end up empty,
so this returns the coarsest picture of the three.
Cuts at the quantiles of the scores, so each group holds a similar number of nodes whatever the shape of the distribution.
Clusters the scores by k-means, so the cuts fall where the scores are furthest apart rather than at fixed widths or counts.