Reading binary file of structured binary numerical data, for use in reading into R numerical data written from Fortran
readf2cio(fn,imax=Inf,verbose=FALSE)numeric list, vector or matrix according to layout of information in fn; see Details.
character variable, path to file to be read.
maximum number of list components to be read.
boolean, should the reading be reported?
Peter J. Green
The function is designed to expedite the transfer of possibly large quantities of numeric information, in binary form, written, typically incrementally, in a Fortran routine called from R, without using the arguments to the function.
Assumed format for binary files holding lists, matrices or vectors of numeric data:
writable from Fortran via f2cio interface, readable in R using readBin
file structure supported: binary file, with integer(4), real(4) or double(8) data
first record: list: 0 0
matrix or vector: nc mode (mode = 1, 2 or 3 for integer(4), real(4) or double(8))
succeeding records, one per component of list or row of matrix:
list: number of items, mode as integers, followed by data for this component
(note that modes can differ between but not within components)
matrix or vector: data for this row
one-column matrices are delivered as vectors
data(galx)
z<-Nmix('galx',nsweep=10000,nburnin=1000,out="d")
z
Run the code above in your browser using DataLab