round_preserve_sum: Forces rounded numbers to total their UNrounded sum, to any...

Description Usage Arguments Details Value Examples

View source: R/RoundingFunctions.R

Description

round_preserve_sum

Usage

1
round_preserve_sum(x, digits = 0)

Arguments

x

a vector of numeric values

digits

what to round to, defaults to 0

Details

This functions returns a rounded vector of numbers, ensuring that they add to the same total as before rounding.

Value

A character string

Examples

1
2
round_preserve_sum(c(2.2,4.5,8.7))
round_preserve_sum(c(2.2,4.5,8.7), digits = 1)

jdjohn215/MLSPTools documentation built on Sept. 2, 2020, 1:16 a.m.