[R] Question about Line Ending Choice

Enrico Schumann e@ @end|ng |rom enr|co@chum@nn@net
Thu Sep 29 11:24:35 CEST 2022


On Tue, 27 Sep 2022, Stephen H. Dawson, DSL via R-help writes:

> Hi All,
>
>
> I am writing with a question about choosing the line
> ending aspect of a file, please.
>
> I use write.csv and write.table to export work to CSV
> files and TXT files. I am planning now on how to share
> my work with the Windows crowd beyond only sharing with
> the Linux crowd. I use my text editor to flip the line
> ending option from Linux to Windows after
> exporting. This is inefficient for me to accomplish if
> I ramp up production as I expect will occur.
>
> Staying with the character encoding of UTF-8 seems fine
> for now from what I understand I need to deliver to my
> customers.
>
> What seems more efficient to me is to learn how to use
> R to define the line ending aspect of the exported
> file. I have not found if this is an option within R.
>
> QUESTION
> Is it possible within R to define the line ending aspect of file output?
>
>
> Kindest Regards,

Just a remark: there is a "standard" for CSV,
https://datatracker.ietf.org/doc/html/rfc4180.
It always requires CRLF as the line ending.

-- 
Enrico Schumann
Lucerne, Switzerland
http://enricoschumann.net



More information about the R-help mailing list