I'm trying to write a function equivalent to scales::dollar
that adds a pound (£) symbol to the beginning of a figure. Since the scales code is so robust, I've used it as a framework and simply replaced the $ for the £.
A stripped-down function example:
pounds<-function(x) paste0("£",x)
When I run a 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 extensions guide it doesn't give a lot of help (IMO) on how to resolve this issue. It mentions the \uxxxx and says it refers to Unicode characters.
Looking up unicode characters yields me the code £
but the guidance I can find for \uxxxx
is minimal and relates to Java on W3schools.
My question is thus:
How do you implement the usage of non-unicode characters in R functions using the \uxxxx escapes and how does the usage affect the display of such characters after the function has been used?