Re: [R] command similar to colSums for rowSums?

2009-11-30 Thread Will Carr
>> >> max(apply(yourArray, 3, rowSums)) >> >> give you what you want? >> >> -Peter Ehlers >> >> Will Carr wrote: >>> Working with an NxMxO sized matrix, currently I can do this in my code: >>> >>> if (max(colSums(array

Re: [R] command similar to colSums for rowSums?

2009-11-30 Thread Will Carr
This gives the correct result but appears to be slower than the for loop I was using, I do appreciate the suggestion though. Peter Ehlers wrote: > > Does this > > max(apply(yourArray, 3, rowSums)) > > give you what you want? > > -Peter Ehlers > > Will

Re: [R] command similar to colSums for rowSums?

2009-11-30 Thread Will Carr
David Winsemius wrote: > > What are M, N, and O? All the same magnitude? > In this case, 4,13,10. > What are you doing based on that if( ) determination? > Increasing a counter. > Are you sure you are interpreting your profile results correctly? > No, but I think I am. I'm using proc.t

[R] command similar to colSums for rowSums?

2009-11-30 Thread Will Carr
Working with an NxMxO sized matrix, currently I can do this in my code: if (max(colSums(array)) >= number) But to get an equivalent result using rowSums, I have to do: for (i in 1:10) { if (max(rowSums(array[,,i])) >= number) } I'm running both in a much larger loop that loops millions of tim