ran_round {stratallo} | R Documentation |
Random Rounding of Numbers
Description
A number is rounded to integer
according to the following
rule:
where function , is defined as:
and is number that is generated from
Uniform(0, 1)
distribution.
Usage
ran_round(x)
Arguments
x |
( |
Value
An integer vector.
Examples
x <- c(4.5, 4.1, 4.9)
set.seed(5)
ran_round(x) # 5 4 4
set.seed(6)
ran_round(x) # 4 4 5
[Package stratallo version 2.2.1 Index]