From ripley at stats.ox.ac.uk  Tue Jan 18 17:52:33 2011
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Tue, 18 Jan 2011 16:52:33 +0000 (GMT)
Subject: [Rd] format scientific + plotmath potential bug
In-Reply-To: <4D3594A0.3040205@gmail.com>
References: <4D34BD4A.8030503@emory.edu> <4D3594A0.3040205@gmail.com>
Message-ID: <alpine.LFD.2.00.1101181651260.10449@gannet.stats.ox.ac.uk>

I already had a solution under test, so the bug is now fixed and 
closed.

On Tue, 18 Jan 2011, Duncan Murdoch wrote:

> On 17/01/2011 5:06 PM, Philip Johnson wrote:
>> I have run into a potential bug somewhere between format (specifically
>> scientific notation) and plotmath that results in displaying:
>> 	$1e+01^{2e+00}$
>> instead of
>> 	$10^2$
>> 
>> Reproduce by:
>> 	plot.new()
>> 	a=format(10, scientific=TRUE)
>> 	mtext(expression(10^2), line=1) # looks like $1e+01^{2e+00}$
>> 	10 # this fixes the problem on the next line
>> 	mtext(expression(10^2), line=2) # looks like $10^2$
>> 
>> I can narrow the trigger somewhat further by replacing the "a=..." line
>> with:
>> 	a=.Internal(format(10, FALSE, NULL, 0L, NULL, 3L, TRUE, TRUE))
>> Tracing this call into the C started giving me a headache, so I'm hoping
>> that one of the R core gurus can confirm&  file a bug report if necessary.
>> 
>> I ran into this on Ubuntu / Lucid using R version 2.10.1 (2009-12-14).
>> I confirmed it still exists in R 2.12.1 (2010-12-16) on a fresh install
>> of Ubuntu / Maverick.
>
> Yes, I see this too in R-devel and 2.12.1.  Definitely a bug, and I've 
> submitted it to the bug system:
>
> https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14477
>
> If you want to be kept up to date about fixes you can add yourself to the CC 
> list there.
>
> Duncan Murdoch
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
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, UK                Fax:  +44 1865 272595



[Rd] format scientific + plotmath potential bug
Prof Brian Ripley