6
When trying to create an infinite vector (1:Inf
) I received the following message:
Error in 1:Inf : result would be Too long a vector
However, when the vector does not know in memory the message is usually different. The code below creates the three situations: a) can create the vector, b) does not fit in memory and c) "Too long".
object.size(1:1e9) # limite superior do tipo a
# 4000000040 bytes
object.size(1:1e10) # limite inferior do tipo b
# Error: cannot allocate vector of size 74.5 Gb
...
object.size(1:1e15) # limite superior do tipo b
# Error: cannot allocate vector of size 7450580.6 Gb
object.size(1:1e16) # limite inferior do tipo c
# Error in 1:1e+16 : result would be too long a vector
Question: given that the two vectors (type b and type c) would not fit in memory, such as the R
defines that it falls in one case or the other?
Does this number have any reason to be?
– Tomás Barcellos
@Tomásbarcellos Then I no longer know... Until I tried to look, ams I did not find... He is 2 52...
– Daniel Falbel