【发布时间】:2019-07-12 18:35:09
【问题描述】:
有人可以告诉我这是什么版本的 purrr:
fl <- list(sin, cos, cos, sqrt)
x <- seq(0, 1, length.out = 10)
Reduce(function(f, ...) f(...), fl, x, right = T)
(我尝试reduce和accumulate都没有成功。)
【问题讨论】:
有人可以告诉我这是什么版本的 purrr:
fl <- list(sin, cos, cos, sqrt)
x <- seq(0, 1, length.out = 10)
Reduce(function(f, ...) f(...), fl, x, right = T)
(我尝试reduce和accumulate都没有成功。)
【问题讨论】:
library(purrr)
lift(compose)(fl)(x)
#> [1] 0.5143953 0.5528477 0.5880842 0.6202147 0.6493739 0.6757146 0.6994011
#> [8] 0.7206037 0.7394947 0.7562439
由reprex package (v0.2.1) 于 2019-02-19 创建
或者
compose(!!! fl)(x)
【讨论】:
!!!) 不起作用。有办法解决吗?