[Rd] Why is as.function() slower than eval(call("function"())?

2017-08-04 Thread Gregory Werbin
(Apologies if this is better suited for R-help.) On my system (macOS Sierra, late 2014 MacBook Pro; R 3.4.1, Homebrew build), I found that it is faster to construct a function using eval(call("function", ...)) than using as.function(list(...)). Example: make_fn_1 <- function(a, b) eval(call

Re: [Rd] Why is as.function() slower than eval(call("function"())?

2017-08-04 Thread Joshua Ulrich
On Thu, Aug 3, 2017 at 11:32 PM, Gregory Werbin wrote: > (Apologies if this is better suited for R-help.) > > On my system (macOS Sierra, late 2014 MacBook Pro; R 3.4.1, Homebrew build), > I found that it is faster to construct a function using eval(call("function", > ...)) than using as.functio

Re: [Rd] Why is as.function() slower than eval(call("function"())?

2017-08-04 Thread Duncan Murdoch
On 04/08/2017 12:32 AM, Gregory Werbin wrote: (Apologies if this is better suited for R-help.) On my system (macOS Sierra, late 2014 MacBook Pro; R 3.4.1, Homebrew build), I found that it is faster to construct a function using eval(call("function", ...)) than using as.function(list(...)). Exa

[Rd] `c` with lists with "bytes" names encoding

2017-08-04 Thread brodie gaslam via R-devel
I'm not entirely sure this even qualifies as a bug given how unusual a case it is: > x <- list('a') > name.x <- '\x81' > Encoding(name.x) <- 'bytes' > names(x) <- name.x > x $`\\x81`[1] "a"> c(x)Error: translating strings with "bytes" encoding is not allowed > unlist(x) Error in unlist(x) :   tr