[R] Fwd: generic methods - in particular the summary function

Christophe Dutang dutangc at gmail.com
Mon Sep 28 07:13:28 CEST 2009


Thanks for your answer.

Yes, I use now a proper NAMESPACE with function declared correctly.

Christophe

Le 27 sept. 2009 à 19:16, David Winsemius a écrit :

>
> On Sep 27, 2009, at 12:52 PM, Christophe Dutang wrote:
>
>> Nobody wants to answer my question... is there something stupid in  
>> it?
>
> I couldn't really say. Not being a user of fitdistrplus I don't have  
> much baseline experience. Had you posted code that produced  
> something to work on,  I might have made an effort at applying the  
> methods I typically use, such as str(<object>), methods(<function>),  
> and printing out the function code. But I am a rather low-level R- 
> user, and as soon as you strart throwing around questions about  
> NAMESPACE, my eyes glaze over and I move to the next question.
>
> When I do install and load fitdistrplus and then execute:
>
> methods(summary)
>
> .. I see a new function which is not even invisible, called  
> summary.fitdist. So it seems to be in my NAMESPACE   ... or at least  
> what I dimly understand about such metaphysical entities. I get an  
> error when I execute your suggestion:
>
> > S3method(summary, fitdist)
> Error: could not find function "S3method"
>
> So I would have assumed that you had a package with that "S3method"  
> function about which you had not informed us. Not sure this helps  
> because, as I said, your question appeared more complex that I  
> considered myself competent to answer.
>
> -- 
> David
>
>>
>> Début du message réexpédié :
>>
>>> De : Christophe Dutang <dutangc at gmail.com>
>>> Date : 19 septembre 2009 11:26:51 HAEC
>>> À : r-help at r-project.org
>>> Objet : generic methods - in particular the summary function
>>>
>>> Hi all,
>>>
>>> I'm currently working on the fitdistrplus package (that basically
>>> fit distributions). There is something I do not understand about the
>>> generic function summary.
>>>
>>> In the current version on CRAN, there is no NAMESPACE saying
>>>
>>> S3method(summary, fitdist)
>>>
>>> .
>>> However if we use summary on an object send by fitdist function it
>>> works fine...
>>>
>>> According to R-lang, we have
>>> "
>>> The most common use of generic functions is to provide print and
>>> summary methods for
>>> statistical ob jects, generally the output of some model fitting
>>> process. To do this, each model
>>> attaches a class attribute to its output and then provides a special
>>> method that takes that output
>>> and provides a nice readable version of it. The user then needs only
>>> remember that print or
>>> summary will provide nice output for the results of any analysis.
>>> "
>>>
>>> I would like to be sure, that if the summary.fitdist is not exported
>>> in the NAMESPACE, then we must use declare it with S3method.
>>>
>>> Thanks in advance
>>>
>>> Christophe
>>>
>>> --
>>> Christophe Dutang
>>> Ph.D. student at ISFA, Lyon, France
>>> website: http://dutangc.free.fr
>>>
>>
>> --
>> Christophe Dutang
>> Ph.D. student at ISFA, Lyon, France
>> website: http://dutangc.free.fr
>>
>>
>>
>>
>>
>>
>>
>> 	[[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
> David Winsemius, MD
> Heritage Laboratories
> West Hartford, CT
>

--
Christophe Dutang
Ph.D. student at ISFA, Lyon, France
website: http://dutangc.free.fr




More information about the R-help mailing list