Learn R Programming

fastml (version 0.7.5)

determine_round_digits: Determine rounding digits for time horizons

Description

Computes a sensible number of decimal digits to round time horizons based on the minimal positive separation between unique finite times.

Usage

determine_round_digits(times)

Value

Integer number of digits between 0 and 6.

Arguments

times

Numeric vector of times.

Details

Uses the smallest strictly positive difference among sorted unique finite times, then returns ceiling(-log10(min_diff)) truncated to \([0, 6]\).

Examples

Run this code
# Not run: determine_round_digits(c(0.1, 0.12, 0.125))
NULL

Run the code above in your browser using DataLab