[R-pkg-devel] Unicode Name Warnings for Package Constant

biii m@iii@g oii de@@ey@ws biii m@iii@g oii de@@ey@ws
Thu Sep 2 17:24:19 CEST 2021


Hello,

 

In the janitor package, we want to optionally support conversion from
Unicode characters that visually map to mu or micro to the character "u".
For that, we were thinking to create an unexported character vector constant
with names of all the Unicode mu/micro characters and values of "u".  As a
work-around, I was able to fix the issue using setNames(), but it was a
non-intuitive fix, and I would prefer to just use create the named character
vector directly.

 

Is there a good way to prevent the warnings below?

 

When running the following (on Windows 10 with R 4.1.0) either during a
normal R session or while checking the package (via devtools::check()), we
get several warnings:

 

mu_to_u <-

  c(

    "\u00b5"="u", "\u03bc"="u", "\u3382"="u", "\u338c"="u", "\u338d"="u",

    "\u3395"="u", "\u339b"="u", "\u33b2"="u", "\u33b6"="u", "\u33bc"="u"

  )

 

  Warnings in file 'R/clean_names.R':

    unable to translate '<U+3382>' to native encoding

    unable to translate '<U+338C>' to native encoding

    unable to translate '<U+338D>' to native encoding

    unable to translate '<U+3395>' to native encoding

    unable to translate '<U+339B>' to native encoding

    unable to translate '<U+33B2>' to native encoding

    unable to translate '<U+33B6>' to native encoding

    unable to translate '<U+33BC>' to native encoding

 

I tried wrapping this in suppressWarnings(), but the warnings still
occurred.

 

Thanks,

 

Bill


	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list