Re: [Rd] The use of match.fun

2016-09-06 Thread Joris Meys
Sorry, I am being a daft idiot again. Turns out that somehow I had an object FUN in my global environment, which explains why I didn't get the result I expected. So please ignore my question and burn my mail on a stake. Cheers Joris On Tue, Sep 6, 2016 at 3:35 PM, Adrian Dușa

Re: [Rd] The use of match.fun

2016-09-06 Thread Adrian Dușa
I am not able to replicate this: > center <- function(x,FUN) FUN(x) > center(1:10, mean) [1] 5.5 > mean <- 4 > center(1:10, mean) Error in center(1:10, mean) : could not find function "FUN" Using a fresh install of version 3.3.1 under MacOS, and tested before with 3.3.0 with the same result.

[Rd] The use of match.fun

2016-09-06 Thread Joris Meys
Dear gurus, I was utterly surprised to learn that one of my examples illustrating the need of match.fun() doesn't give me the expected result. center <- function(x,FUN) FUN(x) center(1:10, mean) mean <- 4 center(1:10, mean) Used to give me the error message "could not find function FUN". Now it