Skip to content
Prev 45694 / 63421 Next

about the 'length' arg of vector()

Hi,

In the man page for vector():

   length: A non-negative integer specifying the desired length.  Double
           values will be coerced to integer: supplying an argument of
           length other than one is an error.

Since long vectors are supported, it doesn't seem to be true anymore
that "double values will be coerced to integer":

   > bigraw <- vector("raw", 3e9)
   > length(bigraw)
   [1] 3e+09
   > storage.mode(length(bigraw))
   [1] "double"

At least not always...

Thanks,
H.