integerize: Convert non-integer to integer

Description Usage Arguments Value Examples

View source: R/util.R

Description

Convert non-integer to integer.
The output will be an integer which is obtained by ceiling() or floor() and the mean of the output of multiple trials equals to the input. For example, if input is 1.7, the output will be 1 by 30% or 2 by 70%.

Usage

1
integerize(number)

Arguments

number

numeric vector.

Value

numerc vector of the same length with the input.

Examples

1
2
3
set.seed(1)
res <- blvibmjp:::integerize(rep(pi, 100))
table(res)

fmsan51/blvibmjp documentation built on Sept. 2, 2020, 9:04 p.m.