zero_plus | R Documentation |
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'.
zero_plus(x, small_pos = 1e-05)
x |
A numeric vector. |
small_pos |
A (small) positive number to replace negative values and 0s. |
A copy of x
in which all values equal to or lower than zero are
replaced by small_pos
.
(x <- rnorm(30)) zero_plus(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.