How can I plot unicode symbols like the WOMENS SYMBOL or the MENS SYMBOL, or other symbols from that codeblock? Apart from setting a font family that contains those characters, R hangs on my system* when using the point character pch
like that:
plot(0, type="n")
points(1, .5, pch=-0xfffdL)
# works
points(1, -.5, pch=-0x1f6b9L)
# R hangs
As the doc states,
Where supported by the OS, negative values specify a Unicode code point, so e.g. -0x2642L is a ‘male sign’ and -0x20ACL is the Euro.
*My sessionInfo()
:
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
[5] LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] rsconnect_0.3.79 tools_3.2.2
Thanks for help & checking on your system in advance.
Edit: Windows hangs when I use RStudio 0.99.879 with the RStudio graphics device. If I use dev.new(noRStudioGD=T)
explicitly, then I get a smiliar error as mentioned in the comments: "Error in plot.xy(xy.coords(x, y), type = type, ...) : invalid input '🚹' in 'utf8towcs'". For now, I'll use the PNG fallback option as mentioned by @42-.