s-news
[Top] [All Lists]

Re: How to sum (matrix) components of a list?

To: John Fox <jfox@mcmaster.ca>
Subject: Re: How to sum (matrix) components of a list?
From: "Henrik Aalborg Nielsen" <immhan@student.dtu.dk>
Date: Wed, 18 Feb 2004 09:23:27 +0100 (MET)
Cc: Eva Cantoni <Eva.Cantoni@metri.unige.ch>, s-news <s-news@wubios.wustl.edu>
In-reply-to: <5.1.0.14.2.20040217073629.0200f008@127.0.0.1>
References: <5.1.0.14.2.20040216071640.0200da90@127.0.0.1> <5.1.0.14.2.20040216071640.0200da90@127.0.0.1> <5.1.0.14.2.20040217073629.0200f008@127.0.0.1>
Dear John and the rest of S-news,

Sorry - I did not check my suggestion enough - only with a list of length
two ...

/Henrik

--------------------------------------------------------------------------
   Henrik Aalborg Nielsen
   Informatics and Mathematical Modelling
   Section for Statistics, Time Series Group
   Technical University of Denmark
   Richard Petersens Plads, Build.321,
   DK-2800 Kgs. Lyngby, Denmark.
   E-mail: han at imm.dtu.dk
--------------------------------------------------------------------------

On Tue, 17 Feb 2004, John Fox wrote:

> Dear Henrik,
>
> At 08:41 AM 2/17/2004 +0100, Henrik Aalborg Nielsen wrote:
> >I believe do.call("+", matrices) will do the job.
>
> It doesn't work for me:
>
>  > do.call("+", matrices)
> Problem in +: argument number 4 in call not matched: "+"(structure(c(1, 2,
> 3, 4), c(2, 2), N
> ULL), structure(c(5, 6, 7, 8), c(2, 2), NULL),
>          structure(c(9, 10, 11, 12), c(2, 2), NULL), structure(c(13, 14,
> 15, 16), c(2, 2),
>          NULL))
> Use traceback() to see the call stack
>
> (S-Plus 6.2 for Windows.)
>
> Regards,
>   John
> -----------------------------------------------------
> John Fox
> Department of Sociology
> McMaster University
> Hamilton, Ontario, Canada L8S 4M4
> email: jfox@mcmaster.ca
> phone: 905-525-9140x23604
> web: www.socsci.mcmaster.ca/jfox
> -----------------------------------------------------
>
>

<Prev in Thread] Current Thread [Next in Thread>