| rray-extremum | R Documentation |
rray_pmax() computes the elementwise maximum of two arrays.
rray_pmin() computes the elementwise minimum of two arrays.
rray_pmax(x, y, ..., na_rm = FALSE)
rray_pmin(x, y, ..., na_rm = FALSE)
x |
An array. |
y |
An array. |
... |
These dots are for future extensions and must be empty. |
na_rm |
If |
The arrays are broadcast to common dimensions first, so they do not have to be the same shape.
When NA and NaN are both present, NA wins, like rray_max(),
rray_min(), max(), and min(). This differs from pmax() and pmin(),
which return whichever comes last:
rray_pmax(NA, NaN) # NA rray_pmax(NaN, NA) # NA pmax(NA, NaN) # NaN
These functions participate in rray's common name determination rules.
An array with the common dimensions and common type of x and y.
x <- array(1:6, c(3L, 2L))
rray_pmax(x, 4L)
rray_pmin(x, 4L)
# Compare each column with a different value through broadcasting
rray_pmax(x, array(c(2L, 5L), c(1L, 2L)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.