On Mo, 2015-02-23 at 16:54 -0500, Duncan Murdoch wrote: > This is a feature: it allows you to have arguments that are never > evaluated, because they are never used, or defaults that depend on > things that are calculated within the function.
I haven't thought about the thing with the default arguments. That's really a feature. Thanks, Daniel > > Duncan Murdoch > > > > conditions <- 1:4 > > test <- lapply(conditions, function(mycondition){ > > #print(mycondition) > > myfn <- function(i) mycondition*i > > return(myfn) > > }) > > > > sapply(test, function(myfn) myfn(2)) > > > > > > > > Cheers, > > Daniel > > > -- Daniel Kaschek Institute of Physics Freiburg University Room 210 Phone: +49 761 2038531 ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel