Bug 15583 - Formatting is missing a space in specific situations
Formatting is missing a space in specific situations
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: I/O
R 3.0.2
All All
: P5 minor
Assigned To: R-core
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-30 05:53 UTC by Ricardo Saporta
Modified: 2013-12-06 19:35 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ricardo Saporta 2013-11-30 05:53:49 UTC
Notice that in the first example below, there is a space missing between 
5623.41 and 10000.00

In other scenarios, there is no such missing space

> 1000* ((10^(1/4)) ^ c(0:4))
[1] 1000.00 1778.28 3162.28 5623.4110000.00

> 1000* ((10^(1/3)) ^ c(0:3))
[1]  1000.00  2154.43  4641.59 10000.00

> 1000* ((10^(1/4)) ^ c(0:5))
[1]  1000.00  1778.28  3162.28  5623.41 10000.00 17782.79
Comment 1 Ricardo Saporta 2013-11-30 05:55:10 UTC
I submitted this as a Mac Gui issue, but then tested in Terminal and observed the same issue.
Comment 2 Brian Ripley 2013-12-06 07:45:12 UTC
Simpler example:

7/0.07

Both new in 3.0.2.
Comment 3 Duncan Murdoch 2013-12-06 19:35:30 UTC
This is related to the fix to PR#15411:  in that case, extra spaces were added.
We were too aggressive in removing them.  (The underlying reason for adding the spaces was that scientific format may do more rounding than fixed format:  on numbers like 9996 with 3 digit accuracy, scientific gives 1e+04, fixed gives 9996.  But in your examples both do the rounding, so we shouldn't compensate for it.)

I will commit a fix shortly.