On Aug 23, 2010, at 12:39 PM, Thaler, Thorn, LAUSANNE, Applied
Mathematics wrote:
Perfectly, works as expected. Regarding the other questions, can
anybody point me to the right direction?
So first question: where is the `+` operation defined for tables?
tables are a modification vi
] Sum a list of tables
Reduce(`+`, k)
On Mon, Aug 23, 2010 at 12:18 PM, Thaler, Thorn, LAUSANNE, Applied Mathematics
wrote:
Hi all,
In R it is possible to sum tables:
> (a <- table(rep(1:3, sample(10,3
1 2 3
2 5 7
> a+a
1 2 3
4 10 14
Now suppose that I have a list
sorry, cancel that. I will try again.
On Mon, Aug 23, 2010 at 12:35 PM, RICHARD M. HEIBERGER wrote:
> Reduce(`+`, k)
>
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEA
Reduce(`+`, k)
On Mon, Aug 23, 2010 at 12:18 PM, Thaler, Thorn, LAUSANNE, Applied
Mathematics wrote:
> Hi all,
>
> In R it is possible to sum tables:
>
> > (a <- table(rep(1:3, sample(10,3
>
> 1 2 3
> 2 5 7
>
> > a+a
>
> 1 2 3
> 4 10 14
>
> Now suppose that I have a list of tables, wher
Hi all,
In R it is possible to sum tables:
> (a <- table(rep(1:3, sample(10,3
1 2 3
2 5 7
> a+a
1 2 3
4 10 14
Now suppose that I have a list of tables, where each table counts the
same things
> k <- list(a,a,a)
How can I sum all tables in k?
> do.call(sum, k)
[1] 42
does not
5 matches
Mail list logo