cyril.humbert@univ-mlv.fr
2005-Jun-15 16:51 UTC
[Rd] (PR#7942) extra spaces before imag part when printing complex numbers
Prof Brian Ripley wrote:> This is intentional: it aligns the numbers. E.g. > > >options(width=12) > >print(c(1+1i, 1-10i, 1+100i)) > [1] 1+ 1i > [2] 1- 10i > [3] 1+100i > > Neat, eh? > > What made you think this was a bug?Ah ok, I've misunderstood this feature probably perhaps because, at first sight, I found the display looks "strange" when some of the numbers have large imaginary parts as it tends to make the delimitation between columns of numbers less visible. E.g.,> options(width=80) > print(rep(c(1+1i, 1-1i, 1+1000i), 8))And if there's less than a line of numbers I find it's more natural to write :> print(c(1+1i, 1-1i, 1+1000i))[1] 1+1i 1-1i 1+1000i instead of what is actually printed : [1] 1+ 1i 1- 1i 1+1000i Anyway, sorry this "bug" report.> On Wed, 15 Jun 2005 cyril.humbert at univ-mlv.fr wrote: > > >Hello, > > > >When printing sequence of complex numbers, extra spaces > >are sometimes printed between real and imaginary part of > >each number. > > > >For example: > >## R Version 2.1.1 beta (2005-06-13) [Debian unstable, i386] > >## and R Version 2.1.0 [Debian unstable, i386] > > > >>print(c(1+1i, 10+1i, 100+1i)) # Ok > >[1] 1+1i 10+1i 100+1i > > > >>print(c(1+1i, 1-10i, 1+100i)) > >[1] 1+ 1i 1- 10i 1+100i > > ^^ ^ > > (extra spaces)-- Cyril
Reasonably Related Threads
- Re: (PR#7005) X11 , plot(...expression(...)): missing parentheses
- (PR#7803) print.data.frame(), wrong column names alignement,
- Re: (PR#7005) X11 , plot(...expression(...)): missing parentheses
- plot(..., type="h") w/ origin not at y=0
- hitting ^C breaks readline history (PR#1606)