rowMins: Row-wise minimum and maximum of a matrix.

View source: R/min_max.R

Row-wise minimum and maximumR Documentation

Row-wise minimum and maximum of a matrix.

Description

Row-wise minimum and maximum of a matrix.

Usage

rowMins(x, value = FALSE)
rowMaxs(x, value = FALSE)
rowMinsMaxs(x)

Arguments

x

A numerical matrix with data.

value

If the value is FALSE it returns the indices of the minimum/maximum, otherwise it returns the minimum and maximum values.

Value

A vector with the relevant values.

Author(s)

Manos Papadakis

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

See Also

colMins, colMaxs, nth, rowrange colMedians, colVars, colSort, rowSort

Examples

x <- matrix( rnorm(10 * 10), ncol = 10 )

s1 <- rowMins(x)
#s2 <- apply(x, 1, min)

s1 <- rowMaxs(x)
#s2 <- apply(x, 1, max)

#s1 <- c(apply(x, 1, min),apply(x, 1, max) )
s2 <- rowMinsMaxs(x)

x<-s1<-s2<-NULL

Rfast documentation built on Nov. 9, 2023, 5:06 p.m.