Re: [R] applying max elementwise to two vectors

2007-06-28 Thread Greg Snow
to:[EMAIL PROTECTED] On Behalf Of > Afshartous, David > Sent: Thursday, June 28, 2007 2:20 PM > To: r-help@stat.math.ethz.ch > Subject: [R] applying max elementwise to two vectors > > > > All, > > Is there one liner way to obtain the max per observation for > t

Re: [R] applying max elementwise to two vectors

2007-06-28 Thread Bert Gunter
Please... use and **read** the docs: ?max ---> pmax Bert Gunter -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Afshartous, David Sent: Thursday, June 28, 2007 1:20 PM To: r-help@stat.math.ethz.ch Subject: [R] applying max elementwise to

Re: [R] applying max elementwise to two vectors

2007-06-28 Thread Afshartous, David
TECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Afshartous, > David > Sent: Thursday, June 28, 2007 2:20 PM > To: r-help@stat.math.ethz.ch > Subject: [R] applying max elementwise to two vectors > > > > All, > > Is there one liner way to obtain the max per observ

Re: [R] applying max elementwise to two vectors

2007-06-28 Thread Sebastian P. Luque
On Thu, 28 Jun 2007 16:19:39 -0400, "Afshartous, David" <[EMAIL PROTECTED]> wrote: > All, > Is there one liner way to obtain the max per observation for two > vectors? I looked at apply and lapply but it seems that groundwork > would have to be done before applying either of those. The code bel

[R] applying max elementwise to two vectors

2007-06-28 Thread Afshartous, David
All, Is there one liner way to obtain the max per observation for two vectors? I looked at apply and lapply but it seems that groundwork would have to be done before applying either of those. The code below does it but seems like overkill. Thanks! Dave x = rnorm(10) y = rnorm(10) ind = which