rstudio / rmarkdown-cookbook

R Markdown Cookbook. A range of tips and tricks to make better use of R Markdown.
https://bookdown.org/yihui/rmarkdown-cookbook/
578 stars 224 forks source link

Use `.S3method()` rather than `registerS3method()` #392

Open fkohrt opened 1 year ago

fkohrt commented 1 year ago

The cookbook currently encourages the use of registerS3method(). The documentation at help("registerS3method", "base") says, however, that it is “not intended to be called directly”. As an alternative, the method .S3method() can be used (see also Kurt Hornik: S3 Method Lookup).

https://github.com/rstudio/rmarkdown-cookbook/blob/ac81dd085eca9e71365743518d8a6a1d56430a68/examples/print-method.Rmd#L13-L16

See also #186