apply(matrix, 1, sum)
1 or 2 in the parameter means by row or column.
-Ivan
-----Original Message-----
From: gov2001-l-admin(a)fas.harvard.edu
[mailto:gov2001-l-admin@fas.harvard.edu] On Behalf Of John Bright
Sent: Wednesday, February 26, 2003 1:20 AM
To: 'gov2001'
Subject: [gov2001-l] The R "Scoop" command
If I have an m x n matrix and want to sum over the columns onto each row
in
the matrix I know I can do this one row at a time, but I don't have time
for
this--I got shit to do. So I'd like to do this for the whole matrix at
once.
Anyone know how to do that?
John.
_______________________________________________
gov2001-l mailing list
gov2001-l(a)fas.harvard.edu
http://www.fas.harvard.edu/mailman/listinfo/gov2001-l