[R] Creating methods

Göran Broström gb @end|ng |rom eh@r@@e
Mon Apr 24 15:36:10 CEST 2023


Den 2023-04-24 kl. 15:14, skrev Ivan Krylov:
> В Mon, 24 Apr 2023 15:07:50 +0200
> Göran Broström <gb using ehar.se> пишет:
> 
>>> First, you should only ever write a method if you own the generic
>>> or the class.
> 
>> I was stunned when I read it. I write methods all over the place for
>> generics like print, summary, plot, etc.
> 
> You most likely do that for your own classes. It's sufficient to own
> either the generic or the class, though owning both wouldn't hurt.

Thanks, I see. I define a class when I write a method, so no problem. 
What Hadley meant was that I shouldn't rewrite print.lm, for instance.

Göran



More information about the R-help mailing list