Re: [Rd] Advice debugging M1Mac check errors

2024-02-06 Thread Simon Urbanek
> On 7/02/2024, at 5:06 AM, Prof Brian Ripley via R-devel > wrote: > > On 04/02/2024 19:41, Holger Hoefling wrote: >> Hi, >> I wanted to ask if people have good advice on how to debug M1Mac package >> check errors when you don´t have a Mac? Is a cloud machine the best option >> or is there so

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

2024-02-06 Thread Martin Morgan
I went looking and found this in codetools, where it's been for 20 years https://gitlab.com/luke-tierney/codetools/-/blame/master/R/codetools.R?ref_type=heads#L951 I think the call stack in codetools is checkUsagePackage -> checkUsageEnv -> checkUsage, and these are similarly established. The ca

[Rd] Get list of active calling handlers?

2024-02-06 Thread Duncan Murdoch
The SO post https://stackoverflow.com/q/77943180 tried to call globalCallingHandlers() from a function, and it failed with the error message "should not be called with handlers on the stack". A much simpler illustration of the same error comes from this line: try(globalCallingHandlers(warni

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

2024-02-06 Thread Henrik Bengtsson
Here's a dummy example that I think illustrates the problem: toto <- function() { if (runif(1) < 0.5) function(a) a else function(a,b) a+b } > fcn <- toto() > fcn(1,2) [1] 3 > fcn <- toto() > fcn(1,2) [1] 3 > fcn <- toto() > fcn(1,2) Error in fcn(1, 2) : unused argument (2) How can y

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] [EXTERNAL] Re: NOTE: multiple local function definitions for ?fun? with different formal arguments

2024-02-06 Thread Izmirlian, Grant (NIH/NCI) [E] via R-devel
Because functions get called and therefore, the calling sequence matters. It’s just protecting you from yourself, but as someone pointed out, there’s a way to silence such notes. G From: Hervé Pagès Sent: Tuesday, February 6, 2024 2:40 PM To: Izmirlian, Grant (NIH/NCI) [E] ; Duncan Murdoch ;

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

2024-02-06 Thread Izmirlian, Grant (NIH/NCI) [E] via R-devel
The note refers to the fact that the function named ‘fun’ appears to be defined in two different ways. From: Hervé Pagès Sent: Tuesday, February 6, 2024 2:17 PM To: Duncan Murdoch ; Izmirlian, Grant (NIH/NCI) [E] ; r-devel@r-project.org Subject: [EXTERNAL] Re: [Rd] NOTE: multiple local function

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] Advice debugging M1Mac check errors

2024-02-06 Thread J C Nash
M1mac numerical issues should be rare, but when they do pop up they can be disconcerting. The following little script reveals what happens with no extended precision. A few months ago I built this into a "package" and used https://mac.r-project.org/macbuilder/submit.html to run it, getting the

Re: [Rd] Advice debugging M1Mac check errors

2024-02-06 Thread Prof Brian Ripley via R-devel
On 04/02/2024 19:41, Holger Hoefling wrote: Hi, I wanted to ask if people have good advice on how to debug M1Mac package check errors when you don´t have a Mac? Is a cloud machine the best option or is there something else? I presumed this was about a CRAN package, possibly hdf5r which has a

Re: [Rd] NROW and NCOL on NULL

2024-02-06 Thread Simone Giannerini
I just saw this r85704 | hornik | 2023-12-19 00:33:07 -0600 (Tue, 19 Dec 2023) | 1 line Changed paths: M /trunk/doc/NEWS.Rd M /trunk/src/library/base/R/matrix.R M /trunk/src/library/base/man/nrow.Rd M /trunk/src/li