MichaelChirico / r-bugs

A ⚠️read-only⚠️mirror of https://bugs.r-project.org/
20 stars 0 forks source link

[BUGZILLA #14201] str() and signs in imaginary parts #3798

Closed MichaelChirico closed 4 years ago

MichaelChirico commented 4 years ago

From: Christian Hoffmann <c-w.hoffmann@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::>> 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, <CENSORING FROM DETECTED PHONE NUMBER ONWARDS; SEE BUGZILLA>


METADATA

MichaelChirico commented 4 years ago

NOTES: bug is in prettyNum(drop0trailing = TRUE) fixed in 2.10.1 patched


METADATA

MichaelChirico commented 4 years ago

Audit (from Jitterbug): Wed Feb 3 18:31:02 2010 ripley changed notes Wed Feb 3 18:31:02 2010 ripley moved from incoming to In-Out-fixed


METADATA