From plfjohnson at emory.edu  Mon Jan 17 23:06:02 2011
From: plfjohnson at emory.edu (Philip Johnson)
Date: Mon, 17 Jan 2011 17:06:02 -0500
Subject: [Rd] format scientific + plotmath potential bug
Message-ID: <4D34BD4A.8030503@emory.edu>

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.

Thanks,
Philip



[Rd] format scientific + plotmath potential bug
Philip Johnson