[R] How to represent pure linefeeds chr(10) under R for Windows
Prof Brian Ripley
ripley at stats.ox.ac.uk
Wed Nov 5 18:47:02 CET 2003
You must be writing a text file. Use file("foo", "wb"), and sep="\r\n".
On Wed, 5 Nov 2003, Jens Oehlschlägel wrote:
> Brian, Simon,
>
> Thanks for your quick answers. Unfortunately neither \n nor \012 works.
> Under R for Windows (tried on 1.8.0 and 1.5.1) they are automatically
> converted to chr(13)+chr(10).
>
> I need only chr(10) within my string column, and chr(13)+chr(10) at line
> ends of the csv file. If it can't be solved within R, I could workaround by
> substituting all chr(13)+chr(10) into chr(10) after writing the file using a
> system() call. However, writing the files twice would be ugly and performance
> reducing (I am writing an interface).
--
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
More information about the R-help
mailing list