[Rd] shouldn't seq(my_int_vector, length.out=y) be an integer vector?

franknarf by.hook.or at gmail.com
Mon Jun 29 19:03:52 CEST 2015

The class of seq(1L,length.out=6L) is numeric, which is not what I expect.
seq(1L,6L) gives an integer vector; and even seq(1,6) does, so the
departure/inconsistency when length.out is used doesn't seem desirable.

In the code for seq.default, I see

length.out <- ceiling(length.out) 

and I'd suggest wrapping this in as.integer, since apparently ceiling
doesn't return an integer. (I'm sure there's some reason for that.)


View this message in context: http://r.789695.n4.nabble.com/shouldn-t-seq-my-int-vector-length-out-y-be-an-integer-vector-tp4709180.html
Sent from the R devel mailing list archive at Nabble.com.

More information about the R-devel mailing list