[R] hwo can i get a vector that...
Peter Alspach
PAlspach at hortresearch.co.nz
Wed Mar 7 23:30:28 CET 2007
Check out which.max
Peter Alspach
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of bunny
> , lautloscrew.com
> Sent: Thursday, 8 March 2007 11:20 a.m.
> To: R-help at stat.math.ethz.ch
> Subject: Re: [R] hwo can i get a vector that...
>
>
>
>
> > dear all,
> >
> > how can i get a vector that shows the number of the column
> of matrix
> > that contains the maximum of the row ??
> > can´t believe in need a loop for this...
> >
> > i have a 100 x 3 matrix and want to get a 100 x 1 vector
> with values
> > 1,2,3 .
> >
> > there must be a simple solution. i just cannot find it. i think am
> > searching on the wrong end.
> >
> > thx for help in advance.
> >
> > m.
>
>
> EDIT: ok, i know the following by now :)
>
> apply(for18[,-1], 1, max, na.rm=T)
>
> but this doesn´t get me the number of the column - which is
> what i need...
> [[alternative HTML version deleted]]
>
>
>
______________________________________________________
The contents of this e-mail are privileged and/or confidenti...{{dropped}}
More information about the R-help
mailing list