全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
4773 6
2017-10-17
如图,Rstudio保存script文件出现如下选项是什么意思?有什么区别?有没有相关资料介绍?
谢谢
附件列表
1508203629(1).png

原图尺寸 9.39 KB

1508203629(1).png

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2017-10-17 09:42:16
这个就是要设置文件编码格式
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2017-10-17 09:48:47
UTF-8,然后选择set as default 就行了
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2017-10-17 13:40:39
AlexYoung757 发表于 2017-10-17 09:42
这个就是要设置文件编码格式
您好,非常感谢您的回答。您知道这几种编码格式有什么区别吗?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2017-10-17 13:41:11
crystal8832 发表于 2017-10-17 09:48
UTF-8,然后选择set as default 就行了
恩恩,好。多谢。您知道这几种编码格式有什么区别吗?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2017-10-17 15:43:44
拂去尘缘 发表于 2017-10-17 13:41
恩恩,好。多谢。您知道这几种编码格式有什么区别吗?
Starting with version 0.93, RStudio supports non-ASCII characters for input and output.

Console

Unicode characters can be used for both input and output in the console.

Source Editor

The RStudio source editor natively supports Unicode characters. It will allow you to type or paste characters from any language, even ones that are not part of the document's character set. RStudio will allow you to save such documents, but will print a warning to the R console that not all characters could be encoded. If you close the document without re-saving in a more suitable encoding, those characters will be lost.

If in doubt about which encoding to use, use UTF-8, as it can encode any Unicode character.

Reading and Writing Files

The RStudio source editor can read and write files using any character encoding that is available on your system:

You can choose the encoding for reading with File : Reopen with Encoding, which will re-read the current file from disk with the new encoding.
You can also save an open file using a different encoding with File : Save with Encoding.
The Reopen and Save with Encoding commands both display the following dialog:



Setting the Default Encoding

If you frequently use the character set, check "Set as default encoding for source files". You can view or change this default in the Tools : Options (for Windows & Linux) or Preferences (for Mac) dialog, in the General section.

If you don't set a default encoding, files will be opened using UTF-8 (on Mac desktop, Linux desktop, and server) or the system's default encoding (on Windows). When saving a previously unsaved file, RStudio will ask you to choose an encoding if non-ASCII characters are present.

Known Issues

If you call Sys.setlocale with "LC_CTYPE" or "LC_ALL" to change the system locale while RStudio is running, you may run into some minor issues as RStudio assumes the system encoding doesn't change. If you are on Windows, we recommend you only call Sys.setlocale in .Rprofile. If you are on Mac or Linux and want to change the system locale, please visit the support forum and let us know your scenario.
On Windows, R's source function does not work with files that include characters that aren't part of the current system encoding. You may have trouble with RStudio's Run All and Source on Save commands, as they rely on source.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群