>>
>> 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
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
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
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
4 matches
Mail list logo