[R] sum a list of vectors

Stoyanov, Tsvetan tsvetan.stoyanov at mirant.com
Thu Dec 12 23:47:03 CET 2002


In Mathematica there is a neat feature, where you can change the head of a list from "list" to say "+" and obtain a sum of the list elements. 
I can't find a way to sum a list of vectors of same length or list of matrices of the same dimension and was curious if something like that exists in R.  do.call("+",list) doesn't work because "+" accepts only two arguments, I can obviously use loops but this is quite slow and inelegant.

Thanks,
Tsvetan




More information about the R-help mailing list