RE: [R] IFELSE across large array?

2004-12-05 Thread Sander Oom
Dear all, Thanks to the help from the R mailing list we now have a script performing the required tasks, i.e. applying a mask and filter to a 3D array. See script below. Any further suggestions to simplify the code are very welcome. We are currently debugging the larger script of which this sect

RE: [R] IFELSE across large array?

2004-11-23 Thread Ray Brownrigg
> From: "Liaw, Andy" <[EMAIL PROTECTED]> > Date: Tue, 23 Nov 2004 12:28:48 -0500 > > I'll give it half a crack: > > Steps a through c can be done via nested ifelse(), treating A and M as > vectors (as they really are). Step d is the hard one. I'd write a simple > Fortran code and use .Fortran()

RE: [R] IFELSE across large array?

2004-11-23 Thread Marc Schwartz
On Tue, 2004-11-23 at 12:28 -0500, Liaw, Andy wrote: > I'll give it half a crack: > > Steps a through c can be done via nested ifelse(), treating A and M as > vectors (as they really are). Step d is the hard one. I'd write a simple > Fortran code and use .Fortran() for that. > > I don't see how

RE: [R] IFELSE across large array?

2004-11-23 Thread Liaw, Andy
I'll give it half a crack: Steps a through c can be done via nested ifelse(), treating A and M as vectors (as they really are). Step d is the hard one. I'd write a simple Fortran code and use .Fortran() for that. I don't see how any of the *apply() functions can help here, as your operations ar

[R] IFELSE across large array?

2004-11-23 Thread Sander Oom
Dear all, As our previous email did not get any response, we try again with a reformulated question! We are trying to do something which needs an efficient loop over a huge array, possibly functions such as apply and related (tapply, lapply...?), but can't really understand syntax and examples i