Re: [R] Decimal point as a comma in postcript and pdf graphics
Ronny Klein [EMAIL PROTECTED] writes: Hi, after a lengthy but unsuccessfull search I couldn't come up with a solution to the following problem: 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 system is: OS: Debian Unstable R-Version: 2.0.1 System locale: [EMAIL PROTECTED] Could someone, please, help me out or at least point me to the right documentation. I'm just lost at the moment. 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.) 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 ~~ - ([EMAIL PROTECTED]) 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
Re: [R] Decimal point as a comma in postcript and pdf graphics
On Wed, 9 Mar 2005, Ronny Klein wrote: Hi, after a lengthy but unsuccessfull search I couldn't come up with a solution to the following problem: 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 system is: OS: Debian Unstable R-Version: 2.0.1 System locale: [EMAIL PROTECTED] Could someone, please, help me out or at least point me to the right documentation. I'm just lost at the moment. You need to label your axes with comma: R does not support , as a decimal point. Use explicit calls to axis(), or edit the postscript after production. No one has ever requested this before. Since the grammar would not allow , to be used as a decimal point for console input, it is awkward to allow it for output (but a few functions such as write.table do). 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. It's not true! There is a problem with some PDF viewers, worked around a long time ago in R-patched: o Some PDF readers do not define PDFDocEncoding, so pdf()'s ISOLatin1 encoding is now derived from WinAnsi rather than PDFDocEncoding. It seems Adobe changed the standard since the version that the pdf() device was written to support, and some viewers are not backwards compatible. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ 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
Re: [R] Decimal point as a comma in postcript and pdf graphics
Peter Dalgaard [EMAIL PROTECTED] 03/09/05 07:18AM Ronny Klein [EMAIL PROTECTED] writes: Hi, after a lengthy but unsuccessfull search I couldn't come up with a solution to the following problem: 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 system is: OS: Debian Unstable R-Version: 2.0.1 System locale: [EMAIL PROTECTED] Could someone, please, help me out or at least point me to the right documentation. I'm just lost at the moment. 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)) or for the last line: axis(1, at=p, labels=format(p, decimal.mark=',')) (and possibly throw in xlim=range(p) on the hist() call. Or use axTicks(), which is probably a better idea.) 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. Greg Snow, Ph.D. Statistical Data Center [EMAIL PROTECTED] (801) 408-8111 __ 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
RE: [R] Decimal point as a comma in postcript and pdf graphics
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] la part de Peter Dalgaard Envoye : mercredi 9 mars 2005 15:19 Ronny Klein [EMAIL PROTECTED] 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 [EMAIL PROTECTED] 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 ~~ - ([EMAIL PROTECTED]) 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