Re: [Rd] (PR#7942) extra spaces before imag part when printing

From: <ripley_at_stats.ox.ac.uk>
Date: Wed 15 Jun 2005 - 14:44:00 GMT


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?

On Wed, 15 Jun 2005 cyril.humbert@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)
>
>
>
> The numbers of inserted spaces depends on the imaginary
> part which has the largest number of figures:
>
>> print(c(1+1i, 1+12i))
> [1] 1+ 1i 1+12i
> ^
>
>> print(c(1+1i, 1+123i))
> [1] 1+ 1i 1+123i
> ^^
>
>> print(c(1+1i, 1+1234i))
> [1] 1+ 1i 1+1234i
> ^^^

-- 
Brian D. Ripley,                  ripley@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

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Thu Jun 16 00:49:33 2005

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:09 GMT