Question

I need to use R (3.0.2 from pkgsrc) on a remote server (NetBSD) over a ssh connection with X11 forwarding. plot(1) is generating the expected graphic on my local machine, however R is also returning warnings in my terminal session as below.

> plot(1)
Warning messages:
1: In (function (display = "", width, height, pointsize, gamma, bg,  :
  locale not supported by Xlib: some X ops will operate in C locale
2: In (function (display = "", width, height, pointsize, gamma, bg,  :
  X cannot set locale modifiers

I don't know whether this bodes problems that I may encounter later, but I'd like to get everything set up and configured correctly. Would someone please clarify the meaning of the warnings and explain how to address them?

Edit for more info:

> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64--netbsd (64-bit)

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     
> names(X11Fonts())
[1] "serif"        "sans"         "mono"         "Times"        "Helvetica"   
[6] "CyrTimes"     "CyrHelvetica" "Arial"        "Mincho"  

No correct solution

OTHER TIPS

The errors are saying that the X11 graphics driver does not know what font to use (see this discussion). By default, R installs with the C locale set. For linux, you need to set a UTF-8 locale which is prefixed by the language.

For example, for the English in the US, you would set it to 'en_US.UTF-8'.

Try setting the system locale with the Sys.setlocale command like so:

Sys.setlocale("LC_CTYPE", "en_US.UTF-8")
Sys.setlocale("LC_ALL", "en_US.UTF-8")

This can be done through the .bashrc configuration file like so:

export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8

(source)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top