You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems a minimum number of trailing digits is necessary to trigger the expected output in scientific_format(). I'll write up some tests using these examples. Similar examples using comma_format():
The issue is that format() used by scientific() decides whether to use scientific notation or not (parameter scientific), whereas formatC() used by comma() has no such option. I guess using formatC for both would make sense.
I put that bug report up at Hadley's request as I've been going over the examples in the scales and ggplot2 packages for future documentation purposes. I had noticed the difference between the format() and formatC() in the two functions. I had commented to Hadley after running the examples that comma_format() was generating scientific notation more reliably than scientific_format(), but when cranking out examples for the bug report, it became clearer to me that the number of digits of desired precision certainly plays a role in all of this. I'll look more closely into format() and formatC() - thanks for the comments.
I'm just starting in on all of this, so I have a lot to learn. I'm way behind the 8-ball with respect to grid and some of the programming constructs in R relative to the rest of you, so please be patient with what will probably seem like naive and silly questions at times on my part.
The issue is that format() used by scientific() decides whether to use scientific notation or not (parameter scientific), whereas formatC() used by comma() has no such option. I guess using formatC for both would make sense.
Reply to this email directly or view it on GitHub: #7 (comment)
Activity
baptiste commentedon Nov 28, 2011
The issue is that format() used by scientific() decides whether to use scientific notation or not (parameter scientific), whereas formatC() used by comma() has no such option. I guess using formatC for both would make sense.
djmurphy420 commentedon Nov 28, 2011
Hi Baptiste:
I put that bug report up at Hadley's request as I've been going over the examples in the scales and ggplot2 packages for future documentation purposes. I had noticed the difference between the format() and formatC() in the two functions. I had commented to Hadley after running the examples that comma_format() was generating scientific notation more reliably than scientific_format(), but when cranking out examples for the bug report, it became clearer to me that the number of digits of desired precision certainly plays a role in all of this. I'll look more closely into format() and formatC() - thanks for the comments.
I'm just starting in on all of this, so I have a lot to learn. I'm way behind the 8-ball with respect to grid and some of the programming constructs in R relative to the rest of you, so please be patient with what will probably seem like naive and silly questions at times on my part.
Dennis
From: baptiste reply@reply.github.com
To: Dennis Murphy djmurphy0420@yahoo.com
Sent: Sunday, November 27, 2011 5:04 PM
Subject: Re: [scales] Infelicities with scientific_format() (#7)
The issue is that format() used by scientific() decides whether to use scientific notation or not (parameter scientific), whereas formatC() used by comma() has no such option. I guess using formatC for both would make sense.
Reply to this email directly or view it on GitHub:
#7 (comment)