Re: [Rd] NOTE: multiple local function definitions for ?fun? with different formal arguments

2024-02-06 Thread Duncan Murdoch
On 06/02/2024 2:17 p.m., Hervé Pagès wrote: Thanks. Workarounds are interesting but... what's the point of the NOTE in the first place? Creating a function that can't be called could be an error. Presumably you are careful and never try to call it with the wrong signature, but the check code

Re: [Rd] NOTE: multiple local function definitions for ?fun? with different formal arguments

2024-02-06 Thread Hervé Pagès
Thanks. Workarounds are interesting but... what's the point of the NOTE in the first place? H. On 2/4/24 09:07, Duncan Murdoch wrote: > On 04/02/2024 10:55 a.m., Izmirlian, Grant (NIH/NCI) [E] via R-devel > wrote: >> Well you can see that yeast is exactly weekday you have.  The way out >> is t

Re: [Rd] NOTE: multiple local function definitions for ?fun? with different formal arguments

2024-02-04 Thread Duncan Murdoch
On 04/02/2024 10:55 a.m., Izmirlian, Grant (NIH/NCI) [E] via R-devel wrote: Well you can see that yeast is exactly weekday you have. The way out is to just not name the result I think something happened to your explanation... toto <- function(mode) { ifelse(mode == 1, functio

[Rd] NOTE: multiple local function definitions for ?fun? with different formal arguments

2024-02-04 Thread Izmirlian, Grant (NIH/NCI) [E] via R-devel
Well you can see that yeast is exactly weekday you have. The way out is to just not name the result toto <- function(mode) { ifelse(mode == 1, function(a,b) a*b, function(u, v, w) (u + v) / w) } From: Grant Izmirlian Date: Sun, Feb 4, 2024,

[Rd] NOTE: multiple local function definitions for ‘fun’ with different formal arguments

2024-02-03 Thread Hervé Pagès
Hi, I just ran into this 'R CMD check' NOTE for the first time: * checking R code for possible problems ... NOTE toto: multiple local function definitions for ‘fun’ with different   formal arguments The "offending" code is something like this (simplified from the real code): toto <- function(m