In case you need to plot your R graphic using non-US characters or LATIN-1 (French/Spanish/Portuguese) accent (vowels+acute), than you need to plot using Unicode standard codes.

For example, to plot the ‘e’ with acute symbol “é” you need to add the respective code \u{E9} in the label option:

Here some code

xdata=c(rnorm(10))
ydata=c(rnorm(10))
plot(xdata,ydata, main="Testing Unicodes: \u{E7}, \u{D8}", xlab="Where is my e with acute? \u{E9}", ylab="Unicodes")

The output should be like that

unicode sample

You can get all UNICODES at  http://www.unicode.org/charts/PDF/U0080.pdf

Another option would be setting your shell environment to your specific language, before launch R :D. In my case, is the Brazilian Portuguese (Português do Brasil – pt_BR)

export LANG=pt_BR.UTF-8
export LANGUAGE=pt_BR:en

I made a test using a FreeBSD server with en_US support language:

[kaiorafael@n1: ~ $] lu
-bash: lu: command not found
[kaiorafael@n1: ~ $] export LANG=pt_BR.UTF-8
[kaiorafael@n1: ~ $] export LANGUAGE=pt_BR:en
[kaiorafael@n1: ~ $] lu
-bash: lu: comando não encontrado
[kaiorafael@n1: ~ $]

Got some help from:
https://stat.ethz.ch/pipermail/r-help/2010-August/248084.html

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.