Skip to content
Prev 168277 / 398502 Next

name scoping within dataframe index

Every time I have to prefix a dataframe column inside the indexing  
brackets with the dataframe name, e.g.

df[df$colname==value,]

-- I am wondering, why isn't there an R scoping rule that search  
starts with the dataframe names, as if we'd said

with(df, df[colname==value,])

-- wouldn't that be a reasonable default to prepend to the name search  
path?

Cheers,
Alexy