Tal Galili wrote on 12/29/2011 10:52:55 AM:

> Hello all,
> 
> The following line of code includes a right-to-left language text, yet 
the
> R graphics engine displays it from left to right.  One problem this 
causes
> is when there are parenthesis in the test, here is a basic example?
> 
> plot(1:10, main = "×©×?×?× (×?×§×¡×?)")
> 
> Is there a way to make sure the text is displayed from right to left?
> 
> Many thanks for any suggestions,
> Tal
> 
> 
> ----------------Contact
> Details:-------------------------------------------------------
> Contact me: Tal.Galili@gmail.com |  972-52-7275845
> Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
> www.r-statistics.com (English)
> 
----------------------------------------------------------------------------------------------


I'm not sure if this is what you're after, but this function reverses the 
string, character by character and swaps parentheses around.

rev.string <- function(x) {
        revx.indiv <- rev(unlist(strsplit(x, "")))
        revx.indiv2 <- revx.indiv
        revx.indiv2[revx.indiv=="("] <- ")"
        revx.indiv2[revx.indiv==")"] <- "("
        paste(revx.indiv2, collapse="")
        }
plot(1:10, main=rev.string("×©×?×?× (×?×§×¡×?)"))


Jean
	[[alternative HTML version deleted]]

