.NET的Environment.NewLine的R等效项 [英] R equivalent for .NET's Environment.NewLine

查看:102
本文介绍了.NET的Environment.NewLine的R等效项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.NET中的Environment.NewLine ?

我正在寻找一个字符对象,该对象将代表基于环境的新行,例如在Windows上为CR LF("\ r \ n"),在Unix上为CR("\ n").我在R文档或默认的R选项中找不到任何此类内容.

I'm looking for a character object that would represent a new line based on the environment, e.g. CR LF ("\r\n") on Windows and LF ("\n") on Unix. I couldn't find any such thing in the R documentation, or the default R options.

推荐答案

没有对应的功能,但是大多数时候您将不需要它:只要您要编写文本连接,操作系统就可以正确处理并根据平台规范处理'\n';例如,writeLines文档说:

There’s no equivalent, but most of the time you won’t need it: as long as you’re writing to a text connection, the operating system will do the correct thing and treat '\n' according to the platform’s specification; for example, the documentation of writeLines says:

通常writeLines用于文本模式连接,默认分隔符将转换为该平台的普通分隔符(Unix/Linux上为LF,Windows上为CRLF).

Normally writeLines is used with a text-mode connection, and the default separator is converted to the normal separator for that platform (LF on Unix/Linux, CRLF on Windows).

这篇关于.NET的Environment.NewLine的R等效项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆