[R] Summing over an index of an array

From: Saurav Pathak <saurav_at_sas.upenn.edu>
Date: Tue, 19 Feb 2008 18:39:52 -0500


Hi,

I cannot seem to figure out how to sum over an index of a array. For example, let A be a 3 dimensional array. I want to, say, find the sum over the first dimension. That is

        S_jk = Sum_i A_ijk

where now S is a 2-dim matrix. I dont want to use a loop.

Thanks,

-- 
saurav

______________________________________________
R-help_at_r-project.org mailing list
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.
Received on Tue 19 Feb 2008 - 23:44:17 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 20 Feb 2008 - 22:30:15 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive