hi, Richard, > ifelse(..., ..., ...) is not a control structure. It is not special > syntax. It is a normal function call, and it evaluates its arguments > and expands them to a common length just like "+" or, more to the > point, just like "&". > > So why do we have people expecting a normal function call to do > special control structure magic? > > Leaving aside the extending-to-a-common-length part, it's > ifelse <- function (test, true.part, false.part) { > false.part[test] <- true.part[test] > false.part > } > > Why is it so hard to understand that there is nothing special to > understand here?
i wonder if possibly because features like non-standard evaluation lead many of us to conclude there may/should/could be magic at all levels? cheers, Greg ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.