smart.round: Round floats to integers while preserving their sum ref....

View source: R/pictplot.R

smart.roundR Documentation

Round floats to integers while preserving their sum ref. https://stackoverflow.com/questions/32544646/round-vector-of-numerics-to-integer-while-preserving-their-sum

Description

Round floats to integers while preserving their sum ref. https://stackoverflow.com/questions/32544646/round-vector-of-numerics-to-integer-while-preserving-their-sum

Usage

smart.round(x, digits = 1)

Arguments

x

a numeric vector

digits

integer indicating the number of decimal places (round) to be used.

Value

a numeric vector

Examples

smart.round(seq(1,1.5,0.05), 1)

tsuda16k/pictplot documentation built on March 1, 2023, 8:44 p.m.