I am trying to write a function equivalent to scales::dollar that adds a pound (£) symbol to the beginning of a figure. Since the weight code is so stable, I used it as a framework and simply replaced $ with £.
Example truncated function:
pounds<-function(x) paste0("Ā£",x)
When I run CHECK, I get the following:
Found the following file with non-ASCII characters: pounds.R Portable packages must use only ASCII characters in their R code, except perhaps in comments. Use \uxxxx escapes for other characters.
Looking through the Writing R Extension Guide, he does not give much help (IMO) on how to solve this problem. He mentions \ uxxxx and says that it refers to Unicode characters.
Unicode character search gives me the £ code, but the manual I can find for \uxxxx is minimal and applies to Java on W3schools.
My question is:
How to implement the use of non-Unicode characters in R-functions using the \ uxxxx screens and how does the use affect the display of such characters after using the function?
string r unicode ascii
Steph locke
source share