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
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
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
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
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