我的一个 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警告?