Return function that finds maximum of its inputs within a clamping range

clampmax(xmin, xmax, replace.infinite = NA_real_)

## Arguments

xmin, xmax clamping range. If xmax is missing xmin should be a vector of length 2. The value with which to replace non-finite values in the input vector. When codereplace.infinite=FALSE no action is taken. The default value of NA will result in e.g. Inf being mapped to NA.

## Value

A function with signature f(x, ..., na.rm)

## Details

Note that by default infinite values in the input vector are converted to NAs before the being compared with the clampmax range.

## Examples

if (FALSE) {
}