?apply
> x <- rbind(c(2,5,3),c(8,7,2),c(1,8,4))
> apply(x, 1, max)
[1] 5 8 8>
>
On Sat, Mar 28, 2009 at 7:54 PM, Ana M Aparicio Carrasco
<ana.aparicio at upr.edu> wrote:> I need help about how to obtain the max by row in a matrix.
> For example if I have the following matrix:
> 2 5 3
> 8 7 2
> 1 8 4
>
> The max by row will be:
> 5
> 8
> 8
>
> Thank you.
>
> ? ? ? ?[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org 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.
>
--
Jim Holtman
Cincinnati, OH
+1 513 646 9390
What is the problem that you are trying to solve?