bin_balanced: Create Binning Factor and Shorten Following Bins

Description Usage Arguments Details Value

Description

Original name: .binWithEqualValuesBalanced

Usage

1
bin_balanced(x, bins, tol = 1e-08, floor = TRUE)

Arguments

x

Sorted numeric vector to sort into bins.

bins

Intended number of bins.

tol

Distance between successive values of x that are treated as equal.

floor

Set to FALSE to postpone rounding on start and end values.

Details

Equal values of x end up in the same bin, and shortens the following bins. By not taking the floor, a better distribution of samples across bins is achieved.

Value

Integer vector of same length as x, with unique value for each bin.


grahamstewart12/tidyflux documentation built on June 4, 2019, 7:44 a.m.