round.probabilities: Advanced rounding of vectors

Description Usage Arguments Details

View source: R/som.nn.util.R

Description

Rounds a vector of probabilities preserving their sum.

Usage

1
2
## S3 method for class 'probabilities'
round(x, digits = 2)

Arguments

x

numeric vector of values.

digits

demanded precision

Details

In general, if a vector of floating point values is rounded, the sum is not preserverd. For a vector of probabilities (which sum up to 1.0), this may lead to strange results. This function rounds all values of the vector and takes care, that the sum ist not changed (with a precision given in digits).


som.nn documentation built on May 2, 2019, 8:26 a.m.