Skip to contents

This function limits only values which lie outside of [replace_lower, replace_upper]. Values which do not fall outside this range are not modified.

Usage

limit_to_range(x, replace_lower, replace_upper)

Arguments

replace_lower

value to insert in place of elements of value below this bound.

replace_upper

see replace_lower

value

vector to normalise

Value

vector, normalised to range [replace_lower, replace_upper]

Examples

result <- duflor:::limit_to_range(c(0,100,255),0,255)
result2 <- duflor:::limit_to_range(c(0,100,256),0,255)
print(result)
#> [1]   0 100 255
print(result2)
#> [1]   0 100 255