[Rd] str() and signs in imaginary parts (PR#14201)

c-w.hoffmann at sunrise.ch c-w.hoffmann at sunrise.ch
Mon Feb 1 20:40:09 CET 2010


My unix mailer might not work, so I send the report here:

The function "str" perpetuates the sign of the imaginary part of the 
first array element which it should not:


 > str(c(1+2i,1-3i)); str(c(2-4i,11+3i));
 cplx [1:2] 1+2i 1+3i    # note the faulty 1 + 3i
 cplx [1:2] 2-4i  1-3i    # note the faulty 1 - 3i
 > bug.report()
Have a look at

 >  (xx <- complex(real=rnorm(5,0,1),imag=rnorm(5,0,1)))
[1] -0.686846-0.010655i  1.017494-0.644474i  0.212905-0.720527i
[4] -0.843110+1.538344i -1.341294-0.741398i
 > str(xx,vec.len  = 6)
 cplx [1:5] -0.687-0.011i 1.017-0.644i 0.213-0.721i -0.843-1.538i ...
 >

--please do not edit the information below--

Version:
 platform = x86_64-apple-darwin9.8.0
 arch = x86_64
 os = darwin9.8.0
 system = x86_64, darwin9.8.0
 status =
 major = 2
 minor = 10.1
 year = 2009
 month = 12
 day = 14
 svn rev = 50720
 language = R
 version.string = R version 2.10.1 (2009-12-14)

Locale:
C

Search Path:
 .GlobalEnv, package:tools, package:tcltk, package:survival, 
package:stats4, package:splines, package:spatial, package:rpart, 
package:nnet, package:nlme, package:mgcv, package:grid, package:foreign, 
package:datasets, package:codetools, package:cluster, package:class, 
package:boot, package:Matrix, package:MASS, package:graphics, 
package:grDevices, package:KernSmooth, package:stats, package:cwhmisc, 
package:lattice, package:utils, package:methods, Autoloads, package:base

-- 
Christian W. Hoffmann,
Rigiblickstrasse 15 b, CH-8915Hausen am Albis, Switzerland,
Tel +41-44-7640853, c-w.hoffmann at sunrise.ch
www.wsl.ch/personal_homepages/hoffmann/



More information about the R-devel mailing list