I have recently updated to R-4.0.3 and am having trouble running some of my old code.
Some unicode characters seem to be "simplified" by R to the point that they change their meaning or are meaningless.
c("a ≥ b", "√2", "360°")
returns
[1] "a = b" "v2" "360°"
I can correctly render the symbols using their unicode codepoint, but when I do anything to the resulting character vector the special characters are not preserved.
char_str <- c("a \u2265 b", "\u221A2", "360\u00B0")
> char_str
[1] "a ≥ b" "√2" "360°"
> data.frame(char_str)
char_str
1 a = b
2 v2
3 360°
In previous installation of R (3.xx) the ≥ and √ were preserved when put into a data.frame. I am eventually passing a data frame to a flextable::
object to put into a .docx using officer::
. I would settle for a solution that never renders the chars until the final step.