Message-ID: <49D09768.2060409@idi.ntnu.no>
Date: 2009-03-30T09:56:56Z
From: Wacek Kusnierczyk
Subject: "[.data.frame" and lapply
In-Reply-To: <49D093A1.5070707@idi.ntnu.no>
> Bert Gunter wrote:
>
>> "Note that these operations do not match their index arguments in the
>> standard way: argument names are ignored and positional matching only is
>> used. So m[j=2,i=1] is equivalent to m[2,1] and not to m[1,2]. "
>>
>> ## Note that the next lines immediately following say:
>>
>> "This may not be true for methods defined for them; for example it is not
>> true for the data.frame methods described in [.data.frame.
>>
>> To avoid confusion, do not name index arguments (but drop and exact must be
>> named). "
>>
>> So, while it may be fair to characterize the md[,i=3] as a design flaw, it
>> is both explicitly pointed out and warned against. Note that,of course
>>
>> md[,3]
>> ## 3rd column, good practice
>> md[,j=3]
>> ## also 3rd column .. but warned against as bad practice
>>
>> Whether a behavior should be considered a "bug" if it is explicitly warned
>> against in the docs, I leave for others to decide. Too deep for me.
>>
in my humble opinion, if the above (and the previously discussed) is
neither a bug nor a design flaw, then it must be an intentional
misfeature designed specifically to confuse users. have your take.
vQ