The smallest and the largest element along the specified axes, stacked along
a new first axis. You can also use the range() generic.
Usage
nv_range(x, axes = NULL, nan_rm = FALSE)
# S3 method for class 'AnvlArray'
range(..., na.rm = FALSE)Arguments
- x
(
arrayish)
One input. Can be any data type. An R value materializes at its default data type.- axes
(
integer()|NULL)
Axes to reduce over.NULL(default) reduces over all of them, which makes the result a length-2 array likebase::range(). Negative values count from the end.- nan_rm
(
logical(1))
How to handleNaNvalues in float inputs. IfFALSE(default),NaNpropagates. IfTRUE,NaNvalues are skipped.- ...
(
arrayish)
Arrays to reduce, plus named arguments fornv_reduce_min()andnv_reduce_max()(e.g.axes), which are only accepted when there is a single array to reduce.- na.rm
(
logical(1))
Forwarded to thenan_rmargument ofnv_reduce_min()andnv_reduce_max().
Value
(arrayish)
Has the same data type as x and the shape of the reduced array with a
leading axis of size 2 added: element 1 is the minimum, element 2 the
maximum.
The range() generic
range() reduces over all axes and, like base::range(), takes several
data arguments: range(x, y) is the range of both arrays. Beyond base R,
named arguments are passed on, so range(x, axes = 1L) reduces a single
axis – but only when x is the only data argument.