Pmax: Minima and maxima of two vectors/matrices

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Pmin.R

Description

Minima and maxima of two vectors/matrices.

Usage

1
2
3
Pmax(x, y,na.rm = FALSE)
Pmin(x, y,na.rm = FALSE)
Pmin_Pmax(x, y,na.rm = FALSE)

Arguments

x

A numerical vector with numbers.

y

A numerical vector with numbers.

na.rm

TRUE or FAlSE for remove NAs if exists.

Details

The parallel minima or maxima are returned. This are the same as the base functions pmax and pmin.

Value

A numerical vector/matrix with numbers, whose length is equal to the length of the initial vectors/matrices containing the maximum or minimum between each pair.

Author(s)

Manos Papadakis

R implementation and documentation: Manos Papadakis <papadakm95@gmail.com>.

See Also

colSort, rowSort, Sort, colMins

Examples

1
2
3
4
5
6
7
8
x <- rnorm(10)
y <- rnorm(10)
res<-Pmax(x, y)
a<-pmax(x, y)
res<-Pmin(x, y)
b<-pmin(x, y)
res<-Pmin_Pmax(x,y) == c(a,b)
a<-b<-x<-y<-NULL

Example output

Loading required package: Rcpp
Loading required package: RcppZiggurat

Rfast documentation built on Dec. 11, 2021, 9:59 a.m.