Bug 13985 - str() gives odd looking output on complex vectors that are not purely imaginary
str() gives odd looking output on complex vectors that are not purely imaginary
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: Misc
old
ix86 (32-bit) Windows 32-bit
: P5 normal
Assigned To: Jitterbug compatibility account
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-06 03:58 UTC by Jitterbug compatibility account
Modified: 2009-10-06 13:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jitterbug compatibility account 2009-10-06 03:58:07 UTC
From: richcalaway@revolution-computing.com
Full_Name: Rich Calaway
Version: R 2.9.2
OS: Windows Vista
Submission from: (NULL) (65.47.30.18)


Try this:

x <- rnorm(25)
y <- rnorm(25)*1i
z <- x+y
str(z)
str(y)

When I try this, I see the following:

> str(z)
 cplx [1:25] 0.0102+ 0.9463-1 -1.1111+ ...
> str(y)
 cplx [1:25] 0+0.0975i 0-1.5060i 0+0.4071i ...

I see this in 2.9.2 and in the alpha build of 2.10.0:
> sessionInfo()
R version 2.9.2 (2009-08-24) 
i386-pc-intel32 
locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     
other attached packages:
[1] Revobase_0.2-1
loaded via a namespace (and not attached):
[1] pkgXMLBuilder_1.0 XML_2.6-0

> sessionInfo()
R version 2.10.0 alpha (2009-10-04 r49926) 
i386-pc-mingw32 

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

Comment 1 Jitterbug compatibility account 2009-10-06 13:06:19 UTC
From: Martin Maechler <maechler@stat.math.ethz.ch>
>>>>> "RC" == Rich Calaway <richcalaway@revolution-computing.com>
>>>>>     on Tue,  6 Oct 2009 01:00:10 +0200 (CEST) writes:

    RC> Full_Name: Rich Calaway
    RC> Version: R 2.9.2
    RC> OS: Windows Vista
    RC> Submission from: (NULL) (65.47.30.18)


    RC> Try this:

    RC> x <- rnorm(25)
    RC> y <- rnorm(25)*1i
    RC> z <- x+y
    RC> str(z)
    RC> str(y)

    RC> When I try this, I see the following:

    >> str(z)
    RC> cplx [1:25] 0.0102+ 0.9463-1 -1.1111+ ...
    >> str(y)
    RC> cplx [1:25] 0+0.0975i 0-1.5060i 0+0.4071i ...

    RC> I see this in 2.9.2 and in the alpha build of 2.10.0:

Thank you, Rich.

That is indeed a bug in  prettyNum(*, drop0trailing=TRUE)
which I will fix  ASAP.

Martin

Comment 2 Jitterbug compatibility account 2009-10-09 13:04:00 UTC
NOTES:
 changed in 2.10.0alpha
Comment 3 Jitterbug compatibility account 2009-10-09 13:04:57 UTC
Audit (from Jitterbug):
Fri Oct  9 08:04:57 2009	ripley	changed notes
Fri Oct  9 08:04:57 2009	ripley	moved from incoming to Misc-fixed