RobinHankin / partitions

R package for integer partitions
9 stars 5 forks source link

`allbinom(1,1)` causes error #36

Closed jassler closed 1 year ago

jassler commented 1 year ago

Calling allbinom(1,1) causes the following error

Warning: Error in [: incorrect number of dimensions

Trying to widdle it down, I think the this call causes the problem.

multinomial(c(k, n - k))[seq_len(k), , drop = FALSE]
# Error in multinomial(c(k, n - k))[seq_len(k), , drop = FALSE] : 
#   incorrect number of dimensions

This smells like some hidden R shenanigans. Currently, I've just hard-coded the case if both n == k == 1 and have it return matrix(1).

RobinHankin commented 1 year ago

thanks for this, I can confirm the bug. Currently investigating, will get back to you.