RE: [R] Decimal point as a comma in postcript and pdf graphics

From: Christophe Declercq <cdeclercq_at_nordnet.fr>
Date: Thu 10 Mar 2005 - 03:46:45 EST

> De : r-help-bounces@stat.math.ethz.ch
> [mailto:r-help-bounces@stat.math.ethz.ch]De la part de
> Peter Dalgaard
> Envoye : mercredi 9 mars 2005 15:19
>
>
> Ronny Klein <ronny.klein@wiwi.uni-halle.de> writes:

[...]
> > I would like to have a "comma" instead of a "point" as
> the decimal point in my
> > graphics, i.e. postscript and pdf files, for I write my
> thesis in German. My
[...]
>
> We don't have a way of formatting numbers according to
> LC_NUMERIC, as
> far as I know. This leaves it to you to set up axes etc. to your
> liking, e.g.
>
> x <- rnorm(100,,.2)
> p <- pretty(x)
> hist(x,xaxt="n")
> axis(1, at=p, labels=sub("\\.", ",", p))
>
> (and possibly throw in xlim=range(p) on the hist() call. Or use
> axTicks(), which is probably a better idea.)

When I need that, I use something like Peter but with the 'format' function, for example:

  x <- rnorm(100,,.2)
  p <- pretty(x)
  hist(x,xaxt="n")
  axis(1, at=p, labels=format(pretty(x), decimal.mark=","))

Hope it helps.

Christophe

--
Christophe Declercq, MD
Observatoire regional de la sante Nord-Pas-de-Calais
13, rue Faidherbe
F-59046 LILLE Cedex
Phone 33 3 20 15 49 24
Fax 33 3 20 55 92 30
E-mail c.declercq@orsnpdc.org



>
> > Ronny
> >
> >
> > PS: The problem of displaying the German umlauts, I have
> already solved: I
> > have to use the WinAnsi.enc as the default encoding file.
> Which is odd in my
> > opinion.
>
> This should improve in 2.1.0 (or at least be broken in new and
> interesting ways) due to support for UTF-8 encodings.
>
> --
> O__ ---- Peter Dalgaard Blegdamsvej 3
> c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
> (*) \(*) -- University of Copenhagen Denmark Ph:
> (+45) 35327918
> ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX:
> (+45) 35327907
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
>
______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Thu Mar 10 03:53:45 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:42 EST