Almost too good to be true: with this in my NAMESPACE

export (esa.plot)
S3method(esa,plot)

it seems I can deprecate esa.plot by the usual route (calling .Deprecated and 
passing call through to the new function esaPlot).

Thanks!
Murray
________________________________
From: Ivan Krylov <ikry...@disroot.org>
Sent: Wednesday, 2 October 2024 00:45
To: Jan van der Laan <e...@dds.nl>
Cc: Murray Efford <murray.eff...@otago.ac.nz>; Murray Efford via 
R-package-devel <r-package-devel@r-project.org>
Subject: Re: [R-pkg-devel] Deprecating apparent S3 method, changing name

� Tue, 1 Oct 2024 09:00:24 +0200
Jan van der Laan <e...@dds.nl> �����:

> S3method(esa, plot, esaplotmethod)
>
> To register `esaplotmethod` as the method that is called when using
> `esa` with an object of type `plot`. This would prevent this issue.
> However, this probably (can't test as the note doesn't happen on my
> system) doesn't resolve the issue with the NOTE.

Excellent idea, thank you! It does work for R CMD check as well:

Sys.setenv("_R_CHECK_S3_METHODS_SHOW_POSSIBLE_ISSUES_" = 'TRUE')
tools::checkS3methods(dir = '.') # used to show esa.plot as well
# Apparent methods for exported generics not registered:
#   fxi.contour fxi.mode

No need for extra bits or attributes on the esa.plot function, just
register a method for "esa" generic, "plot" class to prevent S3
dispatch from reaching the function in question.

--
Best regards,
Ivan

        [[alternative HTML version deleted]]

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to