[R] What is the matrix version of min()

JeeBee JeeBee at troefpunt.nl
Wed Sep 6 10:58:55 CEST 2006


see ?apply

min.row <- apply(X, 1, min)
min.col <- apply(X, 2, min)

JeeBee

On Wed, 06 Sep 2006 01:37:22 -0700, Tong Wang wrote:

> Hi,
>     Is there a function which operates on a matrix and return a vector of
>     min/max of each rol/col ?
> say,  X=  2,  1
>                 3,  4
> min.col(X)=c(2,1)
> 
> thanks a lot.
> 
> tong
> 
> ______________________________________________ R-help at stat.math.ethz.ch
> mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read
> the posting guide http://www.R-project.org/posting-guide.html and provide
> commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list