2 回答
TA贡献1848条经验 获得超2个赞
对我来说,错误是:
Error: unexpected input in "�"
修补程序是在十六进制编辑器中打开脚本,并从文件中删除前3个字符。该文件是从一个UTF-8 BOM开始的,而且Rscript似乎无法读取它。
编辑:OP请求一个示例。开始吧。
➜ ~ cat a.R
cat('hello world\n')
➜ ~ xxd a.R
00000000: efbb bf63 6174 2827 6865 6c6c 6f20 776f ...cat('hello wo
00000010: 726c 645c 6e27 290a rld\n').
➜ ~ R -f a.R
R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> cat('hello world\n')
Error: unexpected input in "�"
Execution halted
- 2 回答
- 0 关注
- 8636 浏览
添加回答
举报