Duncan Murdoch wrote:
> On 8/5/2005 12:43 PM, Uwe Ligges wrote:
>
>> Duncan Murdoch wrote:
>>
>>> On 8/5/2005 12:16 PM, Martin C. Martin wrote:
>>>
Hi,
I have a 5x731 array A, and I want to compute the sums of the
columns. Currently I do:
apply(A, 2, sum)
Thanks everyone.
Gavin Simpson wrote:
>But neither is that slow on my system. What is A?
>
It's in the middle of a loop. I'm doing some maximum likelihood
estimation, and having to evaluate my model over and over again for
different parameter values.
Thanks,
Martin
__
On 8/5/2005 12:43 PM, Uwe Ligges wrote:
> Duncan Murdoch wrote:
>
>> On 8/5/2005 12:16 PM, Martin C. Martin wrote:
>>
>>>Hi,
>>>
>>>I have a 5x731 array A, and I want to compute the sums of the columns.
>>>Currently I do:
>>>
>>>apply(A, 2, sum)
>>>
>>>But it turns out, this is slow: 70% of my
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Uwe Ligges
> Sent: Friday, August 05, 2005 12:44 PM
> To: Duncan Murdoch
> Cc: r-help@stat.math.ethz.ch
> Subject: Re: [R] Computing sums of the columns of an array
>
&
Duncan Murdoch wrote:
> On 8/5/2005 12:16 PM, Martin C. Martin wrote:
>
>>Hi,
>>
>>I have a 5x731 array A, and I want to compute the sums of the columns.
>>Currently I do:
>>
>>apply(A, 2, sum)
>>
>>But it turns out, this is slow: 70% of my CPU time is spent here, even
>>though there are many
On Fri, 2005-08-05 at 12:16 -0400, Martin C. Martin wrote:
> Hi,
>
> I have a 5x731 array A, and I want to compute the sums of the columns.
> Currently I do:
>
> apply(A, 2, sum)
>
> But it turns out, this is slow: 70% of my CPU time is spent here, even
> though there are many complicated ste
On 8/5/2005 12:16 PM, Martin C. Martin wrote:
> Hi,
>
> I have a 5x731 array A, and I want to compute the sums of the columns.
> Currently I do:
>
> apply(A, 2, sum)
>
> But it turns out, this is slow: 70% of my CPU time is spent here, even
> though there are many complicated steps in my comp
Martin C. Martin wrote:
> Hi,
>
> I have a 5x731 array A, and I want to compute the sums of the columns.
> Currently I do:
>
> apply(A, 2, sum)
colSums(A)
Uwe Ligges
> But it turns out, this is slow: 70% of my CPU time is spent here, even
> though there are many complicated steps in my c
colSums() is a lot faster.
Reid Huntsinger
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Martin C. Martin
Sent: Friday, August 05, 2005 12:17 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Computing sums of the columns of an array
Hi,
I have a 5x731
See ?colSums.
Andy
> From: Martin C. Martin
>
> Hi,
>
> I have a 5x731 array A, and I want to compute the sums of the
> columns.
> Currently I do:
>
> apply(A, 2, sum)
>
> But it turns out, this is slow: 70% of my CPU time is spent
> here, even
> though there are many complicated steps i
Hi,
I have a 5x731 array A, and I want to compute the sums of the columns.
Currently I do:
apply(A, 2, sum)
But it turns out, this is slow: 70% of my CPU time is spent here, even
though there are many complicated steps in my computation.
Is there a faster way?
Thanks,
Martin
__
11 matches
Mail list logo