In the thread Fortran calling R I showed a Fortran code writing unformatted stream data that is then processed by R, and @ivanpribec demonstrated a better approach using his Fortran-Rinside package.