[Rd] str() gives odd looking output on complex vectors that are not purely imaginary (PR#13985)

richcalaway at revolution-computing.com richcalaway at revolution-computing.com
Tue Oct 6 01:00:10 CEST 2009


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



More information about the R-devel mailing list