>Andy,
>
>Maybe this is confusing because the data really ought to be in a dataframe
>with factors coding for treatments?
Can't argue with that logic...it's the principle of the thing you understand.
>
>Here's one solution:
>
>foo[,'z',] <- sapply(foo[,'z',], function(x) max(c(x, 0)))
>
Thanks!
Andy,
Maybe this is confusing because the data really ought to be in a dataframe
with factors coding for treatments?
Here's one solution:
foo[,'z',] <- sapply(foo[,'z',], function(x) max(c(x, 0)))
THK
On 5/26/06, Andy Bunn <[EMAIL PROTECTED]> wrote:
>
> > > This is driving me nuts. I have a 3-
> > This is driving me nuts. I have a 3-D array that holds x,y,z
> > coordinates from multiple experiments. I need to clean the
> data before
> > making it sp objects. I want to set all z-values < 0 to 0. In a 2-D
> > matrix this is trivial e.g., x[,x[1,]<0] <- 0. But I'm
> stumped on how
> >
On Fri, 26 May 2006, Andy Bunn wrote:
> This is driving me nuts. I have a 3-D array that holds x,y,z coordinates
> from multiple experiments. I need to clean the data before making it sp
> objects. I want to set all z-values < 0 to 0. In a 2-D matrix this is
> trivial e.g., x[,x[1,]<0] <- 0. But I
This is driving me nuts. I have a 3-D array that holds x,y,z coordinates
from multiple experiments. I need to clean the data before making it sp
objects. I want to set all z-values < 0 to 0. In a 2-D matrix this is
trivial e.g., x[,x[1,]<0] <- 0. But I'm stumped on how to do this on a 3-D
array wit