Your text file is 672MB. Assuming all your integers are 1 digit, it's perfectly reasonable that your R object is about 2*672MB.
Each character in a text file is 1 byte. R stores integers in 4 bytes (see ?integer
). That means your file contains ~336MB of "\t"
and ~336MB of integers stored as 1-byte characters.
R reads those 1-byte characters, stores them as 4-byte integers and... 336*4 = 1344MB. The second row and second column of your gc
output reads 1345.6, which equals 1344MB + the original 1.6MB.