20190428-R語言循環函數Reduce

-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

;

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容