s."
would be useful examples and comments for R's apply()
help page.
HTH
Steve McKinney
-Original Message-
From: [EMAIL PROTECTED] on behalf of [EMAIL PROTECTED]
Sent: Thu 7/31/2008 3:34 PM
To: Johnson, Eric A. (Seattle)
Cc: r-help@r-project.org
Subject: Re: [R] sort rows of
below is another way ( maybe the same ? )but with an extra line to make
roworder. i'm also not clear on why I have to take the transpose of
the result that
comes back form the apply call. in ?apply, it says that the function
tries to convert the result back to a matrix. that's fine but why doe
If you're not adverse to cbind-ing a1 and a2, you can use this:
a1a2 <- cbind(a1, a2)
a3 <- t(apply(a1a2, 1, function(x) x[order(x[1:ncol(a1)])+ncol(a1)]))
Eric
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Timothy W. Hilton
Sent: Thursday, July 31,
3 matches
Mail list logo