Dear all, in R 3.1.0, this is happening:> cummin(c(1+1i,2-3i,4+5i))Error in cummin(c(1 + (0+1i), 2 - (0+3i), 4 + (0+5i))) : 'cummax' not defined for complex numbers> cummax(c(1+1i,2-3i,4+5i))Error in cummax(c(1 + (0+1i), 2 - (0+3i), 4 + (0+5i))) : 'cummin' not defined for complex numbers It may be fixed in R-devel, but I thought I'd mention it to make sure ... Best, Michael -- Dr. Michael Haupt Principal Member of Technical Staff Phone: +49 331 200 7277, Fax: +49 331 200 7561 Oracle Labs Oracle Deutschland B.V. & Co. KG, Schiffbauergasse 14, 14467 Potsdam, Germany
On Jul 14, 2014, at 9:53 AM, Michael Haupt <michael.haupt at oracle.com> wrote:> Dear all, > > in R 3.1.0, this is happening: > >> cummin(c(1+1i,2-3i,4+5i)) > Error in cummin(c(1 + (0+1i), 2 - (0+3i), 4 + (0+5i))) : > 'cummax' not defined for complex numbers >> cummax(c(1+1i,2-3i,4+5i)) > Error in cummax(c(1 + (0+1i), 2 - (0+3i), 4 + (0+5i))) : > 'cummin' not defined for complex numbers > > It may be fixed in R-devel, but I thought I'd mention it to make sure ... > > Best, > > MichaelThe help file for cummax/cummin in 3.1.1 specifically states: x a numeric or complex ****(not cummin or cummax)**** object, or an object that can be coerced to one of these. So why would you expect it to work for cummin or cummax when you pass a complex 'x'? Regards, Marc Schwartz
Michael Haupt <michael.haupt <at> oracle.com> writes:> > Dear all, > > in R 3.1.0, this is happening: > > > cummin(c(1+1i,2-3i,4+5i)) > Error in cummin(c(1 + (0+1i), 2 - (0+3i), 4 + (0+5i))) : > 'cummax' not defined for complex numbers > > cummax(c(1+1i,2-3i,4+5i)) > Error in cummax(c(1 + (0+1i), 2 - (0+3i), 4 + (0+5i))) : > 'cummin' not defined for complex numbers > > It may be fixed in R-devel, but I thought I'd mention it to make sure ... > > Best, > > MichaelWell, it is documented in the development version: x: a numeric or complex (not ?cummin? or ?cummax?) object, or an object that can be coerced to one of these. I imagine the problem is in coming up with a good, consistent definition of the min/max for complex numbers: would you prefer min/max modulus, phase, real part, imaginary part ... ? max()/min() aren't even defined for complex numbers in R ...