oob | R Documentation |
Replace values below or above a threshold (or bound) with new values
squash_into_low_high(
x,
val_low = 0,
val_low_replace = val_low,
val_high = 1,
val_high_replace = val_high
)
cut0Inf(x, val = NA)
finite01(x, val_low_replace = 0, val_high_replace = 1)
x |
A vector. |
val_low |
A value. The lower threshold (or bound). |
val_low_replace |
A value. The replacement for
values in |
val_high |
A value. The upper threshold (or bound). |
val_high_replace |
A value. The replacement for
values in |
val |
A value. The replacement value. |
x <- seq(-5, 5)
squash_into_low_high(x)
squash_into_low_high(x, val_low = 0, val_high = 3)
squash_into_low_high(
x,
val_low = 0, val_low_replace = -999,
val_high = 3, val_high_replace = 999
)
cut0Inf(c(-5, 0, NA, 0.5, 1, 2, Inf))
finite01(c(-5, 0, NA, 0.5, 1, 2, Inf))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.