[Rd] expand.grid fails on zero dims

Gabor Grothendieck ggrothendieck at gmail.com
Fri Aug 17 16:53:59 CEST 2007


expand.grid fails if any of the arguments are zero length:

> expand.grid(1:2, 1, seq_len(0))
Error in rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) :
        invalid number of copies in rep.int()

I think it would be desirable if it output a data frame with zero rows.



More information about the R-devel mailing list