From murdoch.duncan at gmail.com  Thu Jul 11 14:57:24 2013
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Thu, 11 Jul 2013 14:57:24 +0200
Subject: [Rd] does subset.data.frame need to accept extra arguments?
In-Reply-To: <CABdHhvFxZ13LfhHUbYPsMVSaSCvfE6zz9kLEx628i+0ZTv4QSA@mail.gmail.com>
References: <CAJoaRhbJvHvrzTDdCDh5TNTDWLcBRZ6HTOPguAg=GfkdZoc63g@mail.gmail.com>
	<51DA7B09.3000606@gmail.com>
	<CABdHhvFxZ13LfhHUbYPsMVSaSCvfE6zz9kLEx628i+0ZTv4QSA@mail.gmail.com>
Message-ID: <51DEABB4.7060409@gmail.com>

On 13-07-11 12:59 PM, Hadley Wickham wrote:
>> It needs to have ... in the formal argument list because the generic
>> subset() does.
>>
>> It could enforce a run-time warning that some arguments were being skipped
>> (by testing length(list(...)) for example), but then NextMethod might fail,
>> in a case where an object has a complicated class vector.
>
> That wouldn't be a problem if the check was implemented in
> subset.data.frame, would it?

Suppose the class vector is c("myclass", "data.frame").  Then 
subset.myclass would be called first if it existed.  It might do some 
simple computation and then use NextMethod.  It should not need to know 
that it is calling subset.data.frame next, so it will pass all of its 
arguments along, possibly including some that subset.data.frame should 
ignore.

Duncan Murdoch



[Rd] does subset.data.frame need to accept extra arguments?
Duncan Murdoch