更新时间:2022-03-25 09:18:31
.x
和 .y
仅在有两个参数时指定.如果超过 2 个,我们可以按出现顺序使用 ..1
, ..2
, ..3
The .x
and .y
are only specified when there are two arguments. With more than 2, we can use ..1
, ..2
, ..3
in their order of occurrence
library(purrr)
accumulate2(1:5, 1:4, ~2*..1 + 3*..2 +..3)
#[[1]]
#[1] 1
#[[2]]
#[1] 9
#[[3]]
#[1] 29
#[[4]]
#[1] 73
#[[5]]
#[1] 165