[R] Summing over an index of an array

Saurav Pathak saurav at sas.upenn.edu
Wed Feb 20 00:39:52 CET 2008


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



More information about the R-help mailing list