0

我在 R 中有一个字符串(使用 RStudio)

legend <- c('Up to 5 minutes', '5-10 minutes', '10–20 minutes', '20–40 minutes', '40–80 minutes', '80-160 minutes', '160-320 minutes', '5.3-10.6 hours', '10.6-21.2 hours', '1-2 days')

当我逐行运行源代码时,它运行良好。但是当我获取代码时,它会引发错误

Error in source(con, echo = echo, print.eval = print.eval, max.deparse.length = max.deparse.length,  : 
  con:29:52: unexpected INCOMPLETE_STRING

问题可能出在哪里?

4

1 回答 1

5

RStudio 上发布的讨论更新:

http://support.rstudio.org/help/discussions/problems/3945-bug-when-sourcing-the-application

相关部分:

直到现在我才注意到它但是在开始 RI 时

Enabling Justin-In-Time compilation, level 3.
[1] 0
During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C" 
2: Setting LC_COLLATE failed, using "C" 
3: Setting LC_TIME failed, using "C" 
4: Setting LC_MESSAGES failed, using "C" 
5: Setting LC_PAPER failed, using "C" 
[R.app GUI 1.53 (6335) i386-apple-darwin9.8.0]

WARNING: You're using a non-UTF8 locale, therefore only ASCII characters will work.
Please read R for Mac OS X FAQ (see Help) section 9 and adjust your system preferences accordingly.

阅读常见问题解答我做了标准system("defaults write org.R-project.R force.LANG en_US.UTF-8"),现在它工作正常。

于 2012-11-14T20:58:30.813 回答