create_breaks2: Create breaks vector that can be used with cut(), with log2...

View source: R/grid.R

create_breaks2R Documentation

Create breaks vector that can be used with cut(), with log2 bin width as input.

Description

Create breaks vector that can be used with cut(), with log2 bin width as input.

Usage

create_breaks2(bin_count, min_val, log2_bin_width_inv, log_answers = TRUE)

Arguments

bin_count

Number of bins between breaks.

min_val

Value for the minimum break (fencepost).

log2_bin_width_inv

1 / (log2(bin width)), e.g. 8 means a log2(bin_width) of 0.125

log_answers

This determines whether the break values themselves are log values or not. e.g. if TRUE breaks may be [1, 2, 3] (log2), if FALSE breaks may be [2, 4, 8] (linear).

Value

Vector defining breaks for use with cut(), length == bin_count + 1


uwescience/popcycle documentation built on Jan. 29, 2025, 9:50 a.m.