[R] Correct Localized Numbers on Plots, related to glibc!

Majid Einian einian85 at gmail.com
Sun Jan 15 09:26:36 CET 2012


Dear R Helpers,

I want to localize my plots, i.e. the numbers by x & y axis be
Persian, using Persian numerals and Persian decimal separator. I
change the locale to fa_IR.utf8, but nothing on plots change. I can
change the numerals shaping to Persian ones (۱۲۳۴ instead of 1234)
using some non-standard fonts but the decimal point is a problem. I
asked about that in Persian-Computing mailing list and I got the
answer that follows. I don't know how should I use this "l" flag
mentioned in the answer in R plots (I'm using simple R plots, no
special library).

Has anybody had similar problem in any language (maybe Arabic, other
languages I'm not sure use different numeral characters).
Also I don't have e.g. French locale on my system to see if the
decimal separator changes accordingly to locale for them.

Thanks in advance.

-----------------------------------------------------------------------------
 Roozbeh Pournader <roozbeh at gmail.com>	 Tue, Dec 6, 2011 at 3:47 AM
To: Majid Einian <einian85 at gmail.com>
Cc: persian-computing at googlegroups.com

The glibc model for generating numbers is kind of complex. For using
native digits, one is supposed to use the "I" flag. For example, in
order to get ۱۲٫۳, you should do printf("%I.1f", 12.3).

This is to make sure applications have a way to output both ASCII
numbers, and native numbers.

Roozbeh


-- 
http://persian-computing.org/
http://groups.google.com/group/persian-computing/

----------------------------------------------------------------------------------------------
On Tue, Nov 29, 2011 at 12:04 AM, Majid Einian <einian85 at gmail.com> wrote:

 I have found that decimal seperator in fa_IR.utf8 is . (dot), I
thought it should be U+066B , any comments or ideas why it is not so?
(I am trying to use Persian numbers in my plots in GNU R, if it might help.)


    decimal_point     thousands_sep          grouping
int_curr_symbol   currency_symbol
              "."                ""                ""
"IRR"            "ريال"
mon_decimal_point mon_thousands_sep      mon_grouping
positive_sign     negative_sign
              "‍‍'"               "٫"            "\003"
""               "-"
  int_frac_digits       frac_digits     p_cs_precedes
p_sep_by_space     n_cs_precedes
              "0"               "0"               "0"
"1"               "0"
   n_sep_by_space       p_sign_posn       n_sign_posn
              "1"               "1"               "1"

Regards,
Majid Einian,
PhD Candidate in "Economics",
Graduate School of Management and Economics,
Sharif University of Technology,
Tehran, IRAN



More information about the R-help mailing list