Hello everybody Is there a way to output data into a file like the unformatted, direct fortran files? That's the kind that can be opened with: open(30, file='file', format='unformatted', access='direct', rec=1000, convert='big endian') Thank you in advance Kostas Douvis
Prof Brian Ripley
2008-Jan-07 13:37 UTC
[R] output into an unformatted direct fortran file
On Mon, 7 Jan 2008, Costas Douvis wrote:> Hello everybody > > Is there a way to output data into a file like the unformatted, direct > fortran files? That's the kind that can be opened with: > > open(30, file='file', format='unformatted', access='direct', rec=1000, > convert='big endian')Fortran file formats depend on the compiler and OS, neither of which you have told us. You may be able to write a suitable file with writeBin: I would start by trying to read such a file with readBin. Otherwise you link compiled Fortran into R to do this (if Fortran I/O works, again depends on your unstated system).> Thank you in advance > Kostas Douvis-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Richard.Cotton at hsl.gov.uk
2008-Jan-07 13:39 UTC
[R] output into an unformatted direct fortran file
> Is there a way to output data into a file like the unformatted, direct > fortran files? That's the kind that can be opened with:It sounds like you want to use cat(), e.g. cat("x = ", 1:10, file="test.txt") See also write for outputting matices to file; and write.table and write.csv for data frames. Regards, Richie. Mathematical Sciences Unit HSL ------------------------------------------------------------------------ ATTENTION: This message contains privileged and confidential inform...{{dropped:20}}