Skip to content
Prev 60965 / 63424 Next

simplify2array assumes non-NA dim() -- base or method bug?

Hmm. I think I haven't seen NA dims in base R before. R-lang says
And R-intro says:
I understand "vector of [non-negative] integers" as excluding NA_integer_.

Correspondingly:
Error in dim(a) <- NA_integer_ : the dims contain missing values
Error in matrix(1, NA_integer_) : invalid 'nrow' value (too large or NA)
Error in array(1, NA_integer_) : negative length vectors are not allowed

There must be many more examples where non-NULL dim() is assumed to
not contain missing values.

simplify2array() aligns with that specification and only needs to check
for numeric (non-NULL) dims at this point and not also !anyNA(c.dim).
So my take is that there is no bug.

Best regards,

	Sebastian Meyer


Am 25.08.22 um 04:51 schrieb Michael Chirico via R-devel: