Can anyone explain (perhaps with an example) why the R Language Definitions (Version 2.15.2, 2012-10-26, DRAFT) says the following in section 3.2.6?


"To choose from a list of alternatives that already exists switch() may not be the best way to select one for evaluation. It is often better to use eval() and the subset operator, [[, directly via eval(x[[condition]])."

I can't quite figure out the reasoning behind the recommendation or how to make good use of it.

Many thanks,
Mauricio
	[[alternative HTML version deleted]]

