round.probabilities | R Documentation |
Rounds a vector of probabilities preserving their sum.
## S3 method for class 'probabilities'
round(x, digits = 2)
x |
|
digits |
demanded precision |
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
).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.