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

Hervé Pagès hp@ge@@on@g|thub @end|ng |rom gm@||@com
Sun Feb 4 06:28:57 CET 2024


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(mode)
{
     if (mode == 1)
         fun <- function(a, b) a*b
     else
         fun <- function(u, v, w) (u + v) / w
     fun
}

Is that NOTE really intended? Hard to see why this code would be 
considered "wrong".

I know it's just a NOTE but still...

Thanks,

H.

-- 
Hervé Pagès

Bioconductor Core Team
hpages.on.github using gmail.com

	[[alternative HTML version deleted]]



More information about the R-devel mailing list