Re: [Rd] paste(character(0), collapse="", recycle0=FALSE) should be ""

2020-05-23 Thread Hervé Pagès
On 5/23/20 17:45, Gabriel Becker wrote: Maybe my intuition is just different but when I collapse multiple character vectors together, I expect all the characters from each of those vectors to be in the resulting collapsed one. Yes I'd expect that too. But the **collapse** operation in

Re: [Rd] Surpising behavior when using an active binding as loop index in R 4.0.0

2020-05-23 Thread Deepayan Sarkar
A shorter reproducible example: example(makeActiveBinding) for (fred in 1:3) { 0 } ls() Both problems go away if you first do compiler::enableJIT(2) So looks like a bug in compiling the for loop. -Deepayan On Sat, May 23, 2020 at 5:45 PM Thomas Friedrichsmeier via R-devel wrote: > >

[Rd] writeBin and short writes

2020-05-23 Thread frederik
Dear R-devel, I'm curious why writeBin should always return NULL. Would anyone's code break if we made it return the number of bytes written? I'm not sure how else I'm supposed to use writeBin on a writable connection in non-blocking mode... See attached. Thank you, Frederick >From

Re: [Rd] paste(character(0), collapse="", recycle0=FALSE) should be ""

2020-05-23 Thread Gabriel Becker
Brodie, A good point, but more analogous to what I'm concerned with is > sum(5, numeric(0)) [1] 5 Not 0 (the analogu of Herve's desired behavior). Best, ~G PS Brodie sorry for the double. On Fri, May 22, 2020 at 6:12 PM brodie gaslam wrote: > > On Friday, May 22, 2020, 6:16:45 PM EDT,

Re: [Rd] paste(character(0), collapse="", recycle0=FALSE) should be ""

2020-05-23 Thread Gabriel Becker
Herve (et al.), On Fri, May 22, 2020 at 3:16 PM Hervé Pagès wrote: > Gabe, > > It's the current behavior of paste() that is a major source of bugs: > >## Add "rs" prefix to SNP ids and collapse them in a >## comma-separated string. >collapse_snp_ids <- function(snp_ids) >

Re: [Rd] dbinom link

2020-05-23 Thread Martin Maechler
> Hilmar Berger > on Mon, 18 May 2020 11:25:56 +0200 writes: > What about using the Wayback Machine archive ? The web archive should be > more stable than other links which also might disappear in the future. > E.g. >

Re: [Rd] dbinom link

2020-05-23 Thread Hilmar Berger
What about using the Wayback Machine archive ? The web archive should be more stable than other links which also might disappear in the future. E.g. https://web.archive.org/web/20070610002602/http://www.herine.net/stat/software/dbinom.html , which also links to an archived copy of the

Re: [Rd] ftable <-> data.frame etc {was "justify hard coded in format.ftable"}

2020-05-23 Thread Gabor Grothendieck
That's not the problem. The problem is that if you have ft <- ftable(UCBAdmissions, row.vars = 3:2) ft ## Admit Admitted Rejected ## Dept Gender ## AMale 512 313 ## Female 89 19 ## BMale 353 207

Re: [Rd] round() and signif() do not check argument names when a single argument is given

2020-05-23 Thread Shane Mueller
On Fri, May 22, 2020 at 9:55 PM David Winsemius wrote: > The premise in the first few lines of your preamble is at odds (in the > logical sense) with my understanding of primitive function behavior. Try: > > data.frame(x=1:2,y=letters[1:2])[j=2, i=1] > > David > I had never seen naming indexes

Re: [Rd] GCC warning

2020-05-23 Thread Adrian Dușa
On Sat, May 23, 2020 at 10:01 AM Prof Brian Ripley wrote: > On 23/05/2020 07:38, Simon Urbanek wrote: > > Adrian, > > > > newer compilers are better at finding bugs - you may want to read the > full trace of the error, it tells you that you likely have a memory > overflow when using strncpy() in

Re: [Rd] R-devel's ...names() questions

2020-05-23 Thread Martin Maechler
> William Dunlap via R-devel > on Fri, 22 May 2020 11:53:12 -0700 writes: > Am am missing something or does the new ...names() in R-devel not work > right? No, you are not missing anything, and you are right. Thank you for the report! Martin >> a <- function(x, ...)

Re: [Rd] Compatibility issues caused by new simplify argument in apply function

2020-05-23 Thread Martin Maechler
> Lukas Lehnert via R-devel > on Fri, 22 May 2020 12:26:05 +0200 writes: > Dear R Developers, > the new simplify argument in apply causes that my package (hsdar) does not > pass the > checks in R-devel. > The workaround, Kurt Hornik send me, is working for

Re: [Rd] Surpising behavior when using an active binding as loop index in R 4.0.0

2020-05-23 Thread Thomas Friedrichsmeier via R-devel
Possibly just a symptom of the earlier behavior, but I'll amend my example, below, with an even more disturbing observation: Am Sat, 23 May 2020 13:19:24 +0200 schrieb Thomas Friedrichsmeier via R-devel : [...] > Consider the code below: > > makeActiveBinding("i", > function(value) { >

Re: [Rd] Should 0L * NA_integer_ be 0L?

2020-05-23 Thread Michael Chirico
OK, so maybe one way to paraphrase: For R, the boundedness of integer vectors is an implementation detail, rather than a deeper mathematical fact that can be exploited for this case. One might also expect then that overflow wouldn't result in NA, but rather automatically cast up to numeric? But

[Rd] Surpising behavior when using an active binding as loop index in R 4.0.0

2020-05-23 Thread Thomas Friedrichsmeier via R-devel
Hi, I stumbled upon a surprising behavior when using an active binding as a loop index variable in R 4.0.0. In contrast, the behavior observed in R 3.6.1 is in line with my expectations. Consider the code below: makeActiveBinding("i", function(value) { if

Re: [Rd] Should 0L * NA_integer_ be 0L?

2020-05-23 Thread Martin Maechler
> Michael Chirico > on Sat, 23 May 2020 18:08:22 +0800 writes: > I don't see this specific case documented anywhere (I also tried to search > the r-devel archives, as well as I could); the only close reference > mentions NA & FALSE = FALSE, NA | TRUE = TRUE. And there's

[Rd] Should 0L * NA_integer_ be 0L?

2020-05-23 Thread Michael Chirico
I don't see this specific case documented anywhere (I also tried to search the r-devel archives, as well as I could); the only close reference mentions NA & FALSE = FALSE, NA | TRUE = TRUE. And there's also this snippet from R-lang: In cases where the result of the operation would be the same for

[Rd] base::order breaking change in R-devel

2020-05-23 Thread Jan Gorecki
Hi R developers, There seems to be breaking change in base::order on Windows in R-devel. Code below yields different results on R 4.0.0 and R-devel (2020-05-22 r78545). I haven't found any info about that change in NEWS. Was the change intentional? Sys.setlocale("LC_CTYPE","C")

Re: [Rd] paste(character(0), collapse="", recycle0=FALSE) should be ""

2020-05-23 Thread Hervé Pagès
On 5/22/20 18:12, brodie gaslam wrote: FWIW what convinces me is consistency with other aggregating functions applied to zero length inputs: sum(numeric(0)) ## [1] 0 Right. And 1 is the identity element of multiplication: > prod(numeric(0)) [1] 1 And the empty string is the identity

Re: [Rd] GCC warning

2020-05-23 Thread Prof Brian Ripley
On 23/05/2020 07:38, Simon Urbanek wrote: Adrian, newer compilers are better at finding bugs - you may want to read the full trace of the error, it tells you that you likely have a memory overflow when using strncpy() in your package. You should check whether it is right. Unfortunately we

Re: [Rd] GCC warning

2020-05-23 Thread Simon Urbanek
Adrian, newer compilers are better at finding bugs - you may want to read the full trace of the error, it tells you that you likely have a memory overflow when using strncpy() in your package. You should check whether it is right. Unfortunately we can’t help you more specifically, because I