collapse_cuts_round: Round half away from zero

View source: R/get_FSdata_helpers.R

collapse_cuts_roundR Documentation

Round half away from zero

Description

Base R round() uses round-half-to-even ("banker's rounding"), so round(0.5) == 0 and round(74.5) == 74. Cut coarsening rounds representative thresholds half up (away from zero) so that, e.g., a cluster centroid of 74.5 maps to 75, matching the intuitive "nearest integer" rule.

Usage

collapse_cuts_round(x, digits = 0L)

Arguments

x

Numeric vector.

digits

Integer. Number of decimal places.

Value

Numeric vector rounded half away from zero.


forestsearch documentation built on Nov. 15, 2026, 9:06 a.m.