Java Mailing List Archive

http://www.r-help.com/

Home » R Help for Statistical Computing »

Re: [R] sum of list elements

David Winsemius

2009-07-02

Replies: Find Java Web Hosting

Author LoginPost Reply

On Jul 2, 2009, at 11:24 PM, David Winsemius wrote:

>
> On Jul 2, 2009, at 10:20 PM, Ivo Shterev wrote:
>
>> a = list(diag(3), diag(3), diag(3))
>
>
>
> a = list(diag(3), diag(3), diag(3))
> > sum(unlist(a))
> [1] 9

> Also:
> sum(sapply(a,I))
[1] 9

David Winsemius, MD
Heritage Laboratories
West Hartford, CT

______________________________________________
R-help@(protected)
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
©2008 r-help.com - Jax Systems, LLC, U.S.A.