[R-pkg-devel] UTF-8 characters inside R functions for data transformation

X FiM x||m@|| @end|ng |rom gm@||@com
Tue Dec 21 21:18:53 CET 2021


Dear all,

Somewhat related to a question that I posted a while ago (see
https://stat.ethz.ch/pipermail/r-package-devel/2021q4/007540.html), once
I've got a dataframe in my cache, some of the functions need to use some of
the variables. It turns out that some of the columns contain UTF-8
characters, and therefore I need to be able to call
`metadata$variable.with.áccénts`.

But the package development checks warn me that no non-ASCII characters are
allowed in the files "checking R files for non-ASCII characters ...
WARNING".

I have specified that the package uses UTF-8 in DESCRIPTION ("Encoding:
UTF-8"). I have also defined "options(encoding = "UTF-8")" before calling
the checks, but nothing seems to matter. I have also tried to give the
proper UTF-8 codes, like in `metadata$variable.with.\u00e1cc\u00e9nts`, but
with no luck either. Also it gives an error with "\uxxxx sequences not
supported inside backticks".

So which approach do you recommend? Is there any solution that I can use to
call variables that use non-ASCII characters?

Thank you very much.

-- 
Xavier

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list