楼主: xkdog
18975 8

[问答] 提示错误:grepl("\n", lines, fixed = TRUE) ,怎么办? [推广有奖]

  • 7关注
  • 21粉丝

教师

已卖:2409份资源

副教授

67%

还不是VIP/贵宾

-

威望
0
论坛币
9731 个
通用积分
29.3654
学术水平
56 点
热心指数
57 点
信用等级
30 点
经验
27071 点
帖子
565
精华
0
在线时间
979 小时
注册时间
2005-11-27
最后登录
2024-11-26

楼主
xkdog 发表于 2016-5-7 15:28:14 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
最近用rstudio的时候,总是出现这样的错误,不知道应当怎么办?也不影响其他运行结果。

Warning messages:
1: In grepl("\n", lines, fixed = TRUE) :   input string 1 is invalid in this locale
2: In grepl("\n", lines, fixed = TRUE) :   input string 1 is invalid in this locale


谢谢!


二维码

扫码加我 拉你入群

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

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

关键词:Fixed Lines line GRE TRU invalid

沙发
jiangbeilu 学生认证  发表于 2016-5-7 20:11:28
有可能是你保存了histroy,你把history文件删除就可以了。
已有 1 人评分经验 学术水平 热心指数 信用等级 收起 理由
xkdog + 50 + 5 + 5 + 5 精彩帖子

总评分: 经验 + 50  学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

藤椅
xkdog 发表于 2016-5-8 12:38:08
jiangbeilu 发表于 2016-5-7 20:11
有可能是你保存了histroy,你把history文件删除就可以了。
还真是的,谢谢了!

板凳
jackbrown 发表于 2016-6-17 15:06:26
xkdog 发表于 2016-5-8 12:38
还真是的,谢谢了!
历史文件 是什么意思??我也碰到了这样的问题!!

报纸
deephill 发表于 2016-12-2 21:01:24
我也有这个问题,这么处理,我也试一下

地板
deephill 发表于 2016-12-2 21:10:09
删除了那个 什么 history ,还是不行啊

7
276089470 发表于 2017-10-10 17:22:21

I understand the reason.

I found some source and other IO functions which read the source code from file. On my courses, these scripts are stored with encoding UTF-8, but the default chinese encoding for Chinese Traditional windows users are BIG5. Similar issues might be occurred for other non-English courses.

The solution is to add the argument encoding = "UTF-8", in my case, to these functions or connections. More generally, providing the default encoding or a hook before parsing might be a more robust solution.

Best,

8
tlw1987 发表于 2018-4-17 00:15:13
276089470 发表于 2017-10-10 17:22
I understand the reason.

I found some source and other IO functions which read the source code  ...
你好,请问能否是在哪里这么设置?

9
稚气未脱 学生认证  发表于 2018-11-28 14:31:15
tlw1987 发表于 2018-4-17 00:15
你好,请问能否是在哪里这么设置?
在代码后面加上encoding='UTF-8'就可以了,如下图 QQ图片20181128142956.png
已有 1 人评分论坛币 学术水平 热心指数 信用等级 收起 理由
admin_kefu + 20 + 2 + 2 + 2 热心帮助其他会员

总评分: 论坛币 + 20  学术水平 + 2  热心指数 + 2  信用等级 + 2   查看全部评分

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-31 21:28