I have a simple function in one of my R packages, with one of the arguments symbol = "£"
:
formatPound <- function(x, digits = 2, nsmall = 2, symbol = "£"){
paste(symbol, format(x, digits = digits, nsmall = nsmall))
}
But when running R CMD check
, I get this warning:
* checking R files for non-ASCII characters ... WARNING
Found the following files with non-ASCII characters:
formatters.R
It's definitely that £
symbol that causes the problem. If I replace it with a legitimate ASCII character, like $
, the warning disappears.
Question: How can I use £
in my function argument, without incurring a R CMD check
warning?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…