[R] z[i,j] = x[i,j] * y(i+j) ?
glen_b
glnbrntt at gmail.com
Thu Jul 30 06:32:07 CEST 2009
Gabor Grothendieck wrote:
>
> Try this:
>
> z <- x * y[row(x) + col(x)]
>
Thanks! yes, that's the ticket.
In testing out your solution, I noticed I described my problem wrongly.
Apologies to anyone I confused.
So a clarification for anyone trying to follow this:
The index for y should have been y[i+j-1]
Gabor's solution is correct for the question as asked, and it works just
fine when I apply it to what I *should* have asked:
z <- x * y[row(x) + col(x) -1]
Glen
--
View this message in context: http://www.nabble.com/z-i%2Cj--%3D-x-i%2Cj--*-y%28i%2Bj%29---tp24731799p24732020.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list