zero_plus {mclm} | R Documentation |
Make all values strictly higher than zero
Description
This is an auxiliary function that makes all values in numeric vector x strictly
positive by replacing all values equal to or lower than zero with
the values in small.pos
. small_pos
stands for 'small positive constant'.
Usage
zero_plus(x, small_pos = 1e-05)
Arguments
x |
A numeric vector. |
small_pos |
A (small) positive number to replace negative values and 0s. |
Value
A copy of x
in which all values equal to or lower than zero are
replaced by small_pos
.
Examples
(x <- rnorm(30))
zero_plus(x)
[Package mclm version 0.2.7 Index]