-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
;
网友评论