Skip to content
Prev 304450 / 398503 Next

define subset argument for function lm as variable?

Le mercredi 29 ao?t 2012 ? 04:01 -0700, Joshua Wiley a ?crit :
OK, my phrasing was not really correct. What I meant (and what triggered
the OP question) was : why doesn't the "subset" argument behave the same
in lm() and in subset.data.frame()? Is there any advantage to evaluating
the argument at the object creation?

AFAICS, subset.data.frame() merely uses this trick:
e <- substitute(subset)
r <- eval(e, x, parent.frame())


I'm probably missing something... ;-)