[Rd] mean of complex vector (PR#8842)

Peter Dalgaard p.dalgaard at biostat.ku.dk
Mon May 8 15:43:57 CEST 2006


john.peters at nmi.gov.au writes:

> Full_Name: John Peters
> Version: 2.3.0
> OS: Windows 2000, xp
> Submission from: (NULL) (220.233.20.203)
> 
> 
> In R2.3.0 on Windows 2000 and xp
> 
> > mean(c(1i))
> [1] 0+2i
> > mean(c(1i,1i))
> [1] 0+3i
> > mean(c(1i,1i,1i))
> [1] 0+4i
> 
> OK in R2.2.1

Yes. This comes from a blunder in summary.c, apparently attempting to
copy the code from the REALSXP case, mutatis mutandis, but not quite so...

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



More information about the R-devel mailing list