[Rd] formals() adds 0 to complex function arguments

Hadley Wickham h.wickham at gmail.com
Mon Jan 20 17:33:46 CET 2014


On Sun, Jan 19, 2014 at 3:16 PM, peter dalgaard <pdalgd at gmail.com> wrote:
> It's not formals() that is doing you in. Rather, it is a conspiration between two things:
> (a) R always displays complex constants as x+yi, even if x is zero and (b) there really is no way to specify complex constants with non-zero  real part, i.e. 1+2i is a sum of a real and and imaginary complex constant. You can see the effect already at
>
>> quote(1+2i)
> 1 + (0+2i)

Maybe I'm missing something obvious, but why not omit the real part if
it's zero?

Hadley


-- 
http://had.co.nz/



More information about the R-devel mailing list