RでReduce

Rでもpythonと同じようにreduce関数があるようだ。
試しにベクトルの要素の和を出してみると

>Reduce(function(x,y)x+y,c(1,2,3,4,5))
[1] 15

とちゃんと動作する。