On Jan 26, 2009, at 2:12 PM, Duncan Murdoch wrote:
df[get("colname", parent.frame()) == value,]
Actually, what I propose is a special search rule which simply looks at the enclosing dataframe.name[...] outside the brackets and looks up the columns first.

Yes, I understood that, and I explained why it would be a bad idea.

Well this is the case in all programming languages with scoping where inner-scope variables override the outer ones. Usually it's solved with prefixing with the outer scope, outercsope.name or outerscope::name or so. So it only underscores the need to improve scoping access in R.

Dataframe column names belong to the dataframe object and the natural thing would be to enable easy access to naming; you'd need to apply an extra effort to access an overridden unrelated external variable. Again, just an analogy from other programming languages.

Cheers,
Alexy

______________________________________________
R-help@r-project.org mailing list
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.

Reply via email to