Re: [R-pkg-devel] unregistered S3 methods in a package

2024-09-06 Thread John Fox
Thank you Uwe and Martin for clarifying this issue. The last paragraph of the comments that Kurt pointed out refers to a generic function defined in a package; in my case, the generic is coef(), which is in the stats package not in the cv package, and the question concerned methods for coef()

Re: [R-pkg-devel] unregistered S3 methods in a package

2024-09-05 Thread Martin Maechler
> Uwe Ligges > on Thu, 5 Sep 2024 08:47:06 +0200 writes: > Dear John, > the question is not really easy to answer, but there is a nice summary > Kurt pointed me to: The code of checkS3methods() includes the following > comments with the last paragraph containing the

Re: [R-pkg-devel] unregistered S3 methods in a package

2024-09-04 Thread Uwe Ligges
Dear John, the question is not really easy to answer, but there is a nice summary Kurt pointed me to: The code of checkS3methods() includes the following comments with the last paragraph containing the short answer to your question: ## Check S3 generics and methods consistency. ## U

Re: [R-pkg-devel] unregistered S3 methods in a package

2024-09-04 Thread John Fox
Thanks Toby and Jeff for chiming in on this. Jeff: I already read Kurt Hornik's post on "S3 Method Lookup" and quite a few other sources. The main point is that failing to register the methods works in that the methods are nevertheless invoked internally by functions in the package but don't

Re: [R-pkg-devel] unregistered S3 methods in a package

2024-09-04 Thread Jeff Newmiller via R-package-devel
I have been reluctant to pipe up on this because I am no expert on the dark corners of the S3 dispatch mechanism, but I think unregistered S3 methods in packages are verboten. Perhaps [1] will shed some light? [1] https://blog.r-project.org/2019/08/19/s3-method-lookup/ On September 4, 2024 11:2

Re: [R-pkg-devel] unregistered S3 methods in a package

2024-09-04 Thread Toby Hocking
I got this warning too, so I filed an issue to ask https://github.com/r-lib/roxygen2/issues/1654 On Mon, Sep 2, 2024 at 2:58 PM John Fox wrote: > > As it turned out, I was able to avoid redefining coef.merMod(), etc., by > making a simple modification to the cv package. > > I'm still curious abou

Re: [R-pkg-devel] unregistered S3 methods in a package

2024-09-02 Thread John Fox
As it turned out, I was able to avoid redefining coef.merMod(), etc., by making a simple modification to the cv package. I'm still curious about whether it's OK to have unregistered S3 methods for internal use in a package even though that's no longer necessary for the cv package. On 2024-09

[R-pkg-devel] unregistered S3 methods in a package

2024-09-02 Thread John Fox
Dear R-package-devel list members, I want to introduce several unregistered S3 methods into the cv package (code at ). These methods have the form coef.merMod <- function(object, ...) lme4::fixef(object) The object is to mask, e.g., lme4:::coef.merMod()