-Usage
Reduce(f, x, init, right = FALSE, accumulate = FALSE)
對x的第一壮不、二兩個元素運行函數(shù)f缎玫,得到的結(jié)果與第三個元素再運行函數(shù)f稽穆,以此類推技掏,最后將x的所有元素整合到一起车伞;
-Arguments
x
x為向量(可以是原子向量碧查,也可以是list)坑资,
init
an R object of the same kind as the elements of x.
right
a logical indicating whether to proceed from left to right (default) or from right to left.
accumulate
a logical indicating whether the successive reduce combinations should be
accumulated. By default, only the final combination is used.
-Example
Reduce
;