I am looking for help to read a binary file with R
.
I know the file can be successfully imported in Python with the following code (np for numpy):
dt = np.dtype([('var1', np.uint32), ('var2', np.uint16), ('var3', np.int16),
('var4', np.int16), ('var5', np.int16)])
data = np.fromfile('filename.DAT', dtype=dt)
I, however, don't understand how to use readBin
to import this file in R
. Any help would be appreciated.