From therne@u @ending from m@yo@edu  Tue Jun 26 21:30:44 2018
From: therne@u @ending from m@yo@edu (Therneau, Terry M., Ph.D.)
Date: Tue, 26 Jun 2018 14:30:44 -0500
Subject: [Rd] [EXTERNAL] Re:  list of methods
In-Reply-To: <CAOQ5NyfzhbMjYdVRRMkAWz-GqDxqyt5fRLB=V2Mc000+J1LVqg@mail.gmail.com>
References: <bb6fa2$9mb1it@ironport10.mayo.edu>
 <CAOQ5NyfzhbMjYdVRRMkAWz-GqDxqyt5fRLB=V2Mc000+J1LVqg@mail.gmail.com>
Message-ID: <bb6fa2$9mbmbr@ironport10.mayo.edu>

In a Surv object length() returns number of survival times contained in the object, which 
is the logical thing to do.? The fact that a survival time needs 2 or 3 values to 
represent is simply a nuisance.?? Thus length(unclass(x)) = amount of memory consumed is 
not going to map to sensible operations.

Yes, I'll have to go through the list by hand.? Some methods will only apply to transform 
functions (makepredictcall.pspline), others to model fits (extractAIC.survreg) and others 
to vectors (head.Surv).?? I just need to slog through it.

Looking at Date is a good idea, but it wouldn't have revealed head? or tail.? It did point 
out addition of c() and rep() methods.

Terry

On 06/26/2018 01:40 PM, Michael Lawrence wrote:
> While it's easy to conceive of a utility that found all generics for
> which there is no non-default method for a given class vector, it's
> not clear it would be useful, because it depends on the nature of the
> object. Surv objects are vector-like, so they need to implement the
> "vector API", which is not formally defined. You could look at the
> S4Vectors package or the date/time classes for reference. But Surv
> gets a lot less for free since length() returns twice their logical
> length, an unfortunate inconsistency.
>
> Michael
>
>
>
> On Tue, Jun 26, 2018 at 11:24 AM, Therneau, Terry M., Ph.D. via
> R-devel <r-devel at r-project.org> wrote:
>> I recently got a request to add head() and tail() methods for Surv objects, which is quite
>> reasonable, but not unlike other requests for logLik,  vcov, extractAIC, ...   What they
>> all have in common is that are methods added since creation of the survival package, and
>> that I didn't know they existed.
>>
>> To try and get ahead of the curve, is there a way to list names of all of the default
>> methods?   There are functions to get all the instances of a method by name, e.g.
>> methods("extractAIC") or find all the methods already implemented for a class, but I don't
>> see something give me a list of the ones that I haven't created yet.
>>
>> Terry T.
>>
>>
>>          [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel


	[[alternative HTML version deleted]]



[Rd] [EXTERNAL] Re: list of methods
Therneau, Terry M., Ph.D.