【发布时间】:2012-07-12 13:23:03
【问题描述】:
我的一个 R 包中有一个简单的函数,其中一个参数是 symbol = "£":
formatPound <- function(x, digits = 2, nsmall = 2, symbol = "£"){
paste(symbol, format(x, digits = digits, nsmall = nsmall))
}
但是在运行R CMD check 时,我收到了这个警告:
* checking R files for non-ASCII characters ... WARNING
Found the following files with non-ASCII characters:
formatters.R
肯定是£ 符号导致了问题。如果我将其替换为合法的 ASCII 字符,例如 $,警告就会消失。
问题:如何在我的函数参数中使用£,而不引起R CMD check 警告?
【问题讨论】:
-
也许通过指定编码参数,并设置 latin1 或 utf-8 ?