Re: [R] [newbie] *apply to matching elements of n arrays?

2013-05-11 Thread Bert Gunter
(Private) On Sat, May 11, 2013 at 3:24 PM, Tom Roche wrote: > > Tom Roche Wed, 08 May 2013 20:38:12 -0400 >>> I have two spatial grids defined the same way (i.e., same number of >>> rows and columns--and dimensions, both 2D). Wherever both > >>> * the value of an element i,j in the first grid is

Re: [R] [newbie] *apply to matching elements of n arrays?

2013-05-11 Thread Tom Roche
Tom Roche Wed, 08 May 2013 20:38:12 -0400 >> I have two spatial grids defined the same way (i.e., same number of >> rows and columns--and dimensions, both 2D). Wherever both >> * the value of an element i,j in the first grid is NA >> * the value of element i,j in the second grid is !NA >> I want

Re: [R] [newbie] *apply to matching elements of n arrays?

2013-05-08 Thread William Dunlap
; From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Tom Roche > Sent: Wednesday, May 08, 2013 5:38 PM > To: r-help@r-project.org > Subject: [R] [newbie] *apply to matching elements of n arrays? > > > How to apply a function to all el

Re: [R] [newbie] *apply to matching elements of n arrays?

2013-05-08 Thread Jeff Newmiller
Not particularly interested in "points" from you. Would like reproducibility from you [1], including dput of before and after data, and (inefficient) code of course. For loops are part of R.. If your data structure is not set up to take advantage of vectorization, then for loops are generally

[R] [newbie] *apply to matching elements of n arrays?

2013-05-08 Thread Tom Roche
How to apply a function to all elements with the same indices in multiple arrays? E.g.: I have two spatial grids defined the same way (i.e., same number of rows and columns--and dimensions, both 2D). Wherever both * the value of an element i,j in the first grid is NA * the value of element i,j i