I am currently working with ngrams, which are stored in a data.table in a numeric format, where each word in a vocabulary is given a unique 5 digit number and a single 4-gram looks like this :
10000100001017060484
The reason for storing ngrams in this manner is that numeric objects take up much less space in R. Hence, I am working with some large numbers, which I occasionally need to convert to character and back to do some string manipulation. Today, I noticed that my Rstudio does not seem to store large numbers correctly. For example :
as.numeric(125124313242345145234513234432)
[1] 125124313242345143744028208602
As you can see, the top number is very different from bottom. The only global option I used was:
options(scipen=999)
Can someone explain why is this happening and how can I fix it?
Regards, Kamran.