adaptive_breaks: Generate a set of breaks that attempt to be evenly spaced...

View source: R/graph_binning.R

adaptive_breaksR Documentation

Generate a set of breaks that attempt to be evenly spaced while ensuring each interval has the specified minimum count

Description

Starts by binning the variable by the breaks provided in breaks (if breaks is a vector), or generating a set of breaks at uniformly spaced intervals (if breaks is a single number). It then iteratively merges intervals with counts lower than min_count by removing breaks until all remaining intervals have counts of at least min_count.

Usage

adaptive_breaks(x, min_count, breaks)

Arguments

x

The variable to be binned

min_count

The minimum count for each bin

breaks

Either a vector containing an intital set of breaks or a single number indicating how many uniformly spaced intervals to use when constructing the initial set of breaks. If a single number is provided, the minumum break will be the minimum value of x and the maximum break will be the maximum value of x.


alan-turing-institute/network-comparison documentation built on June 7, 2022, 10:41 p.m.