Re: [R] name scoping within dataframe index

2009-01-26 Thread Duncan Murdoch
On 1/26/2009 2:20 PM, Alexy Khrabrov wrote: 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 colum

Re: [R] name scoping within dataframe index

2009-01-26 Thread Alexy Khrabrov
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 ex

Re: [R] name scoping within dataframe index

2009-01-26 Thread Duncan Murdoch
On 1/26/2009 2:01 PM, Alexy Khrabrov wrote: On 1/26/2009 1:46 PM, Alexy Khrabrov wrote: 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 w

Re: [R] name scoping within dataframe index

2009-01-26 Thread Alexy Khrabrov
On 1/26/2009 1:46 PM, Alexy Khrabrov wrote: 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 wit

Re: [R] name scoping within dataframe index

2009-01-26 Thread Gabor Grothendieck
Try: subset(df, colname == value) On Mon, Jan 26, 2009 at 1:46 PM, Alexy Khrabrov wrote: > 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 s

Re: [R] name scoping within dataframe index

2009-01-26 Thread Duncan Murdoch
On 1/26/2009 1:46 PM, Alexy Khrabrov wrote: 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 wi

[R] name scoping within dataframe index

2009-01-26 Thread Alexy Khrabrov
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