I am wondering if there is anyway to support right-to-left languages in R while using Mac
For instance suppose the following code:
x <- data.frame(a=runif(10),b=runif(10))
ggplot(x, aes(a,b)) + geom_point() + xlab("سلام")
Here is the result:
Here I tried to change the x-label as a Persian/Arabic word (سلام = Hello). While displayed correctly in the code (using R-Studio), in the graph the characters of سلام are displayed in the reverse order (left-to-right).
Also the linkage between two consecutive letters (i.e. س connected to ل would be سل) is broken.
Do you have any idea how to fix it?
Update
With the answer of @agstudy I found R under Ubuntu is perfectly OK. However I have no idea how to solve the problem in Mac (OS X 10.9.1) having updated version of R and R-Studio
rev(unlist(strsplit(your_label_text)))
as a cheap workaround? – Latvia3.0.3 (2014-03-06)
/ Platform:x86_64-pc-linux-gnu (64-bit)
– TranspontineR 3.0.3
and the issue still persists. The issue also persists with baseplot
. – IntervalometerR 2.15.0
. I'm surprised this hasn't been picked up before. – Intervalometerplot(1:10,1:10,ylab="hello",xlab="سلام",cex.lab=5)
shows the same problem, whereas Linux (Ubuntu 12.04, R 3.1.0/devel) does not, and posting it either to the R devel mailing list ([email protected]) or the R MacOS SIG mailing list ... – Heap