Skip to content

R Bug: write.table for matrix of more than 2, 147, 483, 648 elements

2 messages · Steven McKinney, Spencer Graves

#
Hi Colton,

You could divide your write task into chunks that do not violate the 2^31-1 limit.

write.table has an append argument (default FALSE). 

Figure out a row chunk size nri < nr such that nri * nc is under 2^31-1 and use
write.table() to write that out.

Then use 
write.table(  append = TRUE, )
for the next chunk of rows, looping over chunks until done.  Two chunks will get your 2.8 billion entries done.


Best

Steve



Steven McKinney, Ph.D.

Statistician
Molecular Oncology and Breast Cancer Program
British Columbia Cancer Research Centre
#
On 2018-04-18 17:38, Steven McKinney wrote:
????? Magnificent:? Is that something that could be implemented inside 
write.table?


 ????? Spencer