search for: 0xn

Displaying 1 result from an estimated 1 matches for "0xn".

Did you mean: 0x
2024 Jun 26
1
rbind() on zero row matrices is inconsistent
..., 0) # Make a 0x0 matrix N <- matrix(NA, 0, 1) # Make a 0x1 matrix dim(rbind(M, NULL, NULL)) # adds 2 rows to M #> [1] 2 0 dim(rbind(N, NULL, NULL)) # leaves N unchanged #> [1] 0 1 You get an extra row on the 0x0 matrix for each NULL value that is bound to it, but the 0xn matrix is unchanged for n > 0. Clearly from the help this is intentional, but is it desirable? Wouldn't it make more sense for NULL to be ignored by rbind() and cbind()? Duncan Murdoch