ExtremesR Documentation

Maxima and Minima

Description

Returns the (parallel) maxima and minima of the input values.

Usage

pmax2(e1, e2)

pmin2(e1, e2)

## S4 method for signature 'fm,fm'
pmax2(e1, e2)

## S4 method for signature 'fmV,fmV'
pmax2(e1, e2)

## S4 method for signature 'fm,fmV'
pmax2(e1, e2)

## S4 method for signature 'fmV,fm'
pmax2(e1, e2)

## S4 method for signature 'fm,matrix'
pmax2(e1, e2)

## S4 method for signature 'matrix,fm'
pmax2(e1, e2)

## S4 method for signature 'fm,ANY'
pmax2(e1, e2)

## S4 method for signature 'ANY,fm'
pmax2(e1, e2)

## S4 method for signature 'fmV,ANY'
pmax2(e1, e2)

## S4 method for signature 'ANY,fmV'
pmax2(e1, e2)

## S4 method for signature 'fm,fm'
pmin2(e1, e2)

## S4 method for signature 'fmV,fmV'
pmin2(e1, e2)

## S4 method for signature 'fm,fmV'
pmin2(e1, e2)

## S4 method for signature 'fmV,fm'
pmin2(e1, e2)

## S4 method for signature 'fm,matrix'
pmin2(e1, e2)

## S4 method for signature 'matrix,fm'
pmin2(e1, e2)

## S4 method for signature 'fm,ANY'
pmin2(e1, e2)

## S4 method for signature 'ANY,fm'
pmin2(e1, e2)

## S4 method for signature 'fmV,ANY'
pmin2(e1, e2)

## S4 method for signature 'ANY,fmV'
pmin2(e1, e2)

## S4 method for signature 'fm'
min(x, ..., na.rm = FALSE)

## S4 method for signature 'fmV'
min(x, ..., na.rm = FALSE)

## S4 method for signature 'fm'
max(x, ..., na.rm = FALSE)

## S4 method for signature 'fmV'
max(x, ..., na.rm = FALSE)

## S4 method for signature 'fm'
pmin(..., na.rm = FALSE)

## S4 method for signature 'fmV'
pmin(..., na.rm = FALSE)

## S4 method for signature 'fm'
pmax(..., na.rm = FALSE)

## S4 method for signature 'fmV'
pmax(..., na.rm = FALSE)

Arguments

e1, e2

One of the operands need to be a FlashR object. If one operand is a matrix and the other is a vector, we perform the operation on the vector and every column of the matrix. If one operand is a scalar, we perform the operation on the scalar with every element in the matrix or the vector.

x

a FlashR vector or matrix.

...

FlashR vectors or matrices.

na.rm

a logical indicating whether missing values should be removed.

Details

pmax2 returns the maximum of two objects. pmin2 returns the minimum of two objects.

If one of the arguments is a matrix and the other is a vector, pmax2 or pmin2 return a matrix, each of whose column is parallel maxima and minima of the column of the input matrix and the input vector.

Value

pmin2, pmax2, pmin and pmax return a FlashR object, and min and max return an R scalar.

Examples

mat1 <- fm.runif.matrix(100, 10)
mat2 <- fm.runif.matrix(100, 10)
res <- pmax2(mat1, mat2)
res <- pmin2(mat1, mat2)
res <- pmax(mat1, mat2)
res <- pmin(mat1, mat2)
res <- max(mat1, mat2)
res <- min(mat1, mat2)