-Usage
Reduce(f, x, init, right = FALSE, accumulate = FALSE)
對x的第一、二兩個元素運行函數f,得到的結果與第三個元素再運行函數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
;