[R] Use generic functions, e.g. print, without UseMethod?

Sigbert Klinke @|gbert @end|ng |rom w|w|@hu-ber||n@de
Fri Aug 11 09:20:03 CEST 2023


Hello,

I have defined a function 'equations(...)' which returns an object with 
class 'equations'. I also defined a function 'print.equations' which 
prints the object. But I did not use 'equations <- function(x, ...) 
UseMethod("equations"). Two questions:

1.) Is this a sensible approach?
2.) If yes, are there any pitfalls I could run in later?

Thanks

Sigbert

-- 
https://hu.berlin/sk
https://www.stat.de/faqs
https://hu.berlin/mmstat
https://hu.berlin/mmstat-ar



More information about the R-help mailing list