Re: [R-pkg-devel] Unfortunate function name generic.something

2023-05-08 Thread Duncan Murdoch
If anyone wants to try my demo, they can install the test package using remotes::install_github("dmurdoch/testpkg") and see the demonstration by running library(testpkg) example(f) Duncan Murdoch On 08/05/2023 7:23 p.m., Duncan Murdoch wrote: On 08/05/2023 6:58 p.m., Simon Urbanek

Re: [R-pkg-devel] Unfortunate function name generic.something

2023-05-08 Thread Duncan Murdoch
On 08/05/2023 6:58 p.m., Simon Urbanek wrote: On 8/05/2023, at 11:58 PM, Duncan Murdoch wrote: There really isn't such a thing as "a function that looks like an S3 method, but isn't". If it looks like an S3 method, then in the proper circumstances, it will be called as one. I

Re: [R-pkg-devel] Unfortunate function name generic.something

2023-05-08 Thread Simon Urbanek
> On 8/05/2023, at 11:58 PM, Duncan Murdoch wrote: > > There really isn't such a thing as "a function that looks like an S3 method, > but isn't". If it looks like an S3 method, then in the proper circumstances, > it will be called as one. > I disagree - that was the case in old

Re: [R-pkg-devel] Unfortunate function name generic.something

2023-05-08 Thread Duncan Murdoch
On 08/05/2023 12:10 p.m., Ulrike Groemping wrote: Am 08.05.2023 um 15:48 schrieb Duncan Murdoch: On 08/05/2023 8:28 a.m., Ulrike Groemping wrote: Thanks, Duncan. I appreciate the view that levels.no acts as an S3 method for the generic levels, if an object of class "no" is handed to it.

Re: [R-pkg-devel] Unfortunate function name generic.something

2023-05-08 Thread Ulrike Groemping
Am 08.05.2023 um 15:48 schrieb Duncan Murdoch: On 08/05/2023 8:28 a.m., Ulrike Groemping wrote: Thanks, Duncan. I appreciate the view that levels.no acts as an S3 method for the generic levels, if an object of class "no" is handed to it. However, as the function is not intended as an S3 method,

Re: [R-pkg-devel] Unfortunate function name generic.something

2023-05-08 Thread Duncan Murdoch
On 08/05/2023 8:28 a.m., Ulrike Groemping wrote: Thanks, Duncan. I appreciate the view that levels.no acts as an S3 method for the generic levels, if an object of class "no" is handed to it. However, as the function is not intended as an S3 method, it does not make sense to document it as such.

Re: [R-pkg-devel] Unfortunate function name generic.something

2023-05-08 Thread Ulrike Groemping
I certainly could, but I'm using this little convenience function it in so many places (and packages) that this would be a massive amount of work - doesn't feel justified, given the tiny chance of causing a problem. Ulrike Am 08.05.2023 um 14:45 schrieb Hadley Wickham: If it's internal only,

Re: [R-pkg-devel] Unfortunate function name generic.something

2023-05-08 Thread Hadley Wickham
If it's internal only, you could change the name to levels_no()? Hadley On Mon, May 8, 2023 at 7:28 AM Ulrike Groemping wrote: > > Thanks, Duncan. I appreciate the view that levels.no acts as an S3 > method for the generic levels, if an object of class "no" is handed to > it. However, as the

Re: [R-pkg-devel] Unfortunate function name generic.something

2023-05-08 Thread Ulrike Groemping
Thanks, Duncan. I appreciate the view that levels.no acts as an S3 method for the generic levels, if an object of class "no" is handed to it. However, as the function is not intended as an S3 method, it does not make sense to document it as such. As the function is internal only, which makes

Re: [R-pkg-devel] Unfortunate function name generic.something

2023-05-08 Thread Duncan Murdoch
There really isn't such a thing as "a function that looks like an S3 method, but isn't". If it looks like an S3 method, then in the proper circumstances, it will be called as one. In your case the function name is levels.no, and it isn't exported. So if you happen to have an object with a

Re: [R-pkg-devel] Unfortunate function name generic.something

2023-05-08 Thread Ulrike Groemping
Thank your for the solution attempt. However, using the keyword internal does not solve the problem, the note is still there. Any other proposals for properly documenting a function that looks like an S3 method, but isn't? Best, Ulrike Am 05.05.2023 um 12:56 schrieb Iris Simmons: You can add