Greetings! I thought it was a lazy evaluation thing. I added "force" around mycondition and everything worked as expected.
Cheers! On Mon Feb 23 2015 at 1:47:20 PM Jeroen Ooms <jeroeno...@gmail.com> wrote: > On Mon, Feb 23, 2015 at 12:57 PM, Daniel Kaschek > <daniel.kasc...@physik.uni-freiburg.de> wrote: > > Is this a bug or a feature? > > I think it is a bug. If we use substitute to inspect the promise, it > appears the index number is always equal to its last value: > > vec <- c("foo", "bar", "baz") > test <- lapply(vec, function(x){ > function(){x} > }) > substitute(x, environment(test[[1]])) > substitute(x, environment(test[[2]])) > > ______________________________________________ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > [[alternative HTML version deleted]] ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel