Vectorised Min and Max Operators
op-min-max.Rd
Value
A vector of length the longest of the input vectors as returned by pmin()
and pmax()
, or of length zero
if one of the inputs had zero length.
Details
The vectorised infix functions %:<%
and %>:%
may be useful in implementing pmin()
and,
pmax()
and was inspired by the null coalescing operator %||%
.
Note
‘Numeric’ arguments are vectors of type integer and numeric,
and logical (coerced to integer). For historical reasons, NULL
is accepted as equivalent to integer(0)
.
pmax
and pmin
will also work on classed S3 or S4 objects
with appropriate methods for comparison, is.na
and rep
(if recycling of arguments is needed).