This function filters a data vector using a given interval so that only the
values falling inside the interval remains and any value that is less than
the leftmost end gets replaced by that end-value, and similarly, any value
greater than the rightmost end gets replaced by that end-value.
Usage
confined(x, lims = c(0, 1))
Arguments
x
Vector containing data.
lims
Limit for the values. Values falling within this limit will pass
without any change. Any value x < lims[1] will get replaced by lims[1],
and any value x > lims[2] will get replaced by lims[2]. Defaults to
c(0, 1).