Re: [Rd] replicate evaluates its second argument in wrong environment

2021-02-15 Thread Hadley Wickham
On Monday, February 15, 2021, David Winsemius wrote: > > On 2/15/21 1:10 PM, Hadley Wickham wrote: > >> This is a nice example of the motivation for tidy evaluation — since >> enquo() captures the environment in which the promise should be >> evaluated, there's no need for an additional explicit

Re: [Rd] replicate evaluates its second argument in wrong environment

2021-02-15 Thread David Winsemius
On 2/15/21 1:10 PM, Hadley Wickham wrote: This is a nice example of the motivation for tidy evaluation — since enquo() captures the environment in which the promise should be evaluated, there's no need for an additional explicit argument. library(rlang) replicate2 <- function (n, expr,

Re: [Rd] replicate evaluates its second argument in wrong environment

2021-02-15 Thread Hadley Wickham
This is a nice example of the motivation for tidy evaluation — since enquo() captures the environment in which the promise should be evaluated, there's no need for an additional explicit argument. library(rlang) replicate2 <- function (n, expr, simplify = "array") { exnr <- enquo(expr)