Ivan Krylov
2025-Jan-08 16:20 UTC
[Rd] binomial()$linkinv no longer accepts integer values
On Wed, 8 Jan 2025 10:57:47 -0500 Ben Bolker <bbolker at gmail.com> wrote:> I haven't done the archaeology to figure out when this broke/exactly > what change in the R code base broke it: it happened within the last > month or sobinomial() itself exhibits this property even in R-4.2.2 from more than two years ago: R -q -s -e 'getRversion(); binomial()$linkinv(1L)' # [1] ?4.2.2? # Error in binomial()$linkinv(1L) : # REAL() can only be applied to a 'numeric', not a 'integer' It's the `etas` [1] that suddenly became integer due to a change in seq.int(): R -q -s -e 'str(seq.int(-8, 8, by=1))' # num [1:17] -8 -7 -6 -5 -4 -3 -2 -1 0 1 ... R-devel -q -s -e 'str(seq.int(-8, 8, by=1))' # int [1:17] -8 -7 -6 -5 -4 -3 -2 -1 0 1 ... -- Best regards, Ivan [1] https://github.com/lme4/lme4/blob/54c54a320c23b34fea2f7e613928d1ebe7a3fd37/tests/testthat/test-glmFamily.R#L10C5-L10C25
Thanks, that makes sense.
I guess if it never worked for integers (or hasn't worked in a long
time, at least) then it doesn't need to be fixed/changed ...
cheers
Ben
On 2025-01-08 11:20 a.m., Ivan Krylov wrote:> On Wed, 8 Jan 2025 10:57:47 -0500
> Ben Bolker <bbolker at gmail.com> wrote:
>
>> I haven't done the archaeology to figure out when this
broke/exactly
>> what change in the R code base broke it: it happened within the last
>> month or so
>
> binomial() itself exhibits this property even in R-4.2.2 from more than
> two years ago:
>
> R -q -s -e 'getRversion(); binomial()$linkinv(1L)'
> # [1] ?4.2.2?
> # Error in binomial()$linkinv(1L) :
> # REAL() can only be applied to a 'numeric', not a
'integer'
>
> It's the `etas` [1] that suddenly became integer due to a change in
> seq.int():
>
> R -q -s -e 'str(seq.int(-8, 8, by=1))'
> # num [1:17] -8 -7 -6 -5 -4 -3 -2 -1 0 1 ...
> R-devel -q -s -e 'str(seq.int(-8, 8, by=1))'
> # int [1:17] -8 -7 -6 -5 -4 -3 -2 -1 0 1 ...
>
--
Dr. Benjamin Bolker
Professor, Mathematics & Statistics and Biology, McMaster University
> E-mail is sent at my convenience; I don't expect replies outside of
working hours.
Maybe Matching Threads
- binomial()$linkinv no longer accepts integer values
- binomial()$linkinv no longer accepts integer values
- binomial()$linkinv no longer accepts integer values
- binomial()$linkinv no longer accepts integer values
- R (>= 3.4.0): integer-to-double coercion in comparisons no longer done (a good thing)