我有一个1 GB的文件,它是一个250M元素的向量,每个都是一个4字节 - int
(用C ++保存)。
如何将其加载到R向量中?这是自然的方式吗?
f = file("myfile.dat")
readBin(f, integer(), n = 250000000, size = 4, endian = "little")
答案 0 :(得分:1)
实际上问题只是开放binary
模式:
f = file("myfile.dat", open="rb")
readBin(f, integer(), n = 250000000, size = 4, endian = "little")