G'day Ivan, On Fri, 03 Dec 2010 10:54:58 +0100 Ivan Calandra <ivan.calan...@uni-hamburg.de> wrote:
> Arf, yes it makes sense now! Well, my original post said: "R has lazy evaluation" and "the assignment takes place when the function evaluates the argument" :) > So the idea here is: never use "<-" in function argument... Never say never. :) But if you want to perform a (global) assignment within an actual argument to a function, you should better be sure that the formal argument gets evaluated. In fact, this trick is probably a good way, short of studying the source, to find out whether an argument gets evaluated or not (or only occasionally). Cheers, Berwin ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.