Row-wise minimum and maximum | R Documentation |
Row-wise minimum and maximum of a matrix.
rowMins(x, value = FALSE)
rowMaxs(x, value = FALSE)
rowMinsMaxs(x)
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. |
A vector with the relevant values.
Manos Papadakis
R implementation and documentation: Manos Papadakis <papadakm95@gmail.com>.
colMins, colMaxs, nth, rowrange colMedians, colVars, colSort, rowSort
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.