From hadley at rice.edu  Tue Nov 24 00:44:51 2009
From: hadley at rice.edu (Hadley Wickham)
Date: Mon, 23 Nov 2009 17:44:51 -0600
Subject: [Rd] Calling default method for primitive functions
In-Reply-To: <971536df0911231522m707a8010y7ff68985a9b953e@mail.gmail.com>
References: <f8e6ff050911231300p162230d7pad4875528b5e96ff@mail.gmail.com> 
	<971536df0911231522m707a8010y7ff68985a9b953e@mail.gmail.com>
Message-ID: <f8e6ff050911231544k44b619aak2fe5061893b89d82@mail.gmail.com>

Perfect - thanks!
Hadley

On Mon, Nov 23, 2009 at 5:22 PM, Gabor Grothendieck
<ggrothendieck at gmail.com> wrote:
> See ?.subset
>
> On Mon, Nov 23, 2009 at 4:00 PM, Hadley Wickham <hadley at rice.edu> wrote:
>> Hi all,
>>
>> How can I call the default method of a S3 object defined by a
>> primitive method? ? i.e. in the following example, how do I call the
>> default [ method instead of the one I defined for the class.
>>
>> new_a <- function(x) structure(x, class = "a")
>>
>> a <- new_a(1:5)
>>
>> "[.a" <- function(x, i, j, ...) {
>> ?new_a(x[, j, ])
>> }
>>
>> a[, 5]
>
>



-- 
http://had.co.nz/



[Rd] Calling default method for primitive functions
Hadley Wickham