Re: [Rd] confusing all.equal output

2023-03-03 Thread Martin Maechler
not choose well, >> letting a programmer come up with whatever they feel like >> is generally worse. >> >> Yes, in their microcosm centered on a dozen lines of >> code, "current" and "target" may have meaning. But are >

Re: [Rd] confusing all.equal output

2023-03-02 Thread peter dalgaard
d > "target" may have meaning. But are they the intended user of the product? > > -Original Message----- > From: R-devel On Behalf Of Antoine Fabri > Sent: Thursday, March 2, 2023 12:23 PM > To: peter dalgaard > Cc: R-devel > Subject: Re: [Rd] confusing al

Re: [Rd] confusing all.equal output

2023-03-02 Thread avi.e.gross
n Behalf Of Antoine Fabri Sent: Thursday, March 2, 2023 12:23 PM To: peter dalgaard Cc: R-devel Subject: Re: [Rd] confusing all.equal output Good points. I don't mind the terminology since target and current are the names of the arguments. As the function is already designed to stop at

Re: [Rd] confusing all.equal output

2023-03-02 Thread Antoine Fabri
Good points. I don't mind the terminology since target and current are the names of the arguments. As the function is already designed to stop at the first failing check we might not need to enumerate or count the mismatches, instead we could have "`NA` found in `target` but not in `current` at pos

Re: [Rd] confusing all.equal output

2023-03-02 Thread peter dalgaard
Yes... Also, of course, the sentence after colon does not the describe the cause of the mismatch, e.g. > all.equal(c(1,NA,NA), c(NA,NA,3)) [1] "'is.NA' value mismatch: 2 in current 2 in target" could be confusing. Perhaps "is.na() mismatch (2 positions)", with the count calculated as sum(is.n

[Rd] confusing all.equal output

2023-03-01 Thread Antoine Fabri
dear r-devel, This has probably been forever like this but is this satisfying ? all.equal(c(1,NA,NA), c(1,NA,3)) #> [1] "'is.NA' value mismatch: 1 in current 2 in target" is.NA() doesn't exist (is.na() does), and is.na() is never 1 or 2. In this example it's obvious that we're counting missing