From h.wickham at gmail.com  Mon Jan 20 17:33:46 2014
From: h.wickham at gmail.com (Hadley Wickham)
Date: Mon, 20 Jan 2014 10:33:46 -0600
Subject: [Rd] formals() adds 0 to complex function arguments
In-Reply-To: <7630243D-EAA3-4FDA-89D5-25CAEDFEAC94@gmail.com>
References: <CANLFJPpnu2_n9qPXMGnRCupNWtrS6Mm_TjH-pTkSdvUQ523sLA@mail.gmail.com>
	<7630243D-EAA3-4FDA-89D5-25CAEDFEAC94@gmail.com>
Message-ID: <CABdHhvHhf+25oDQ4BerHru8XorRCQp9HR8vYqkEPJ=c=1MA5Sg@mail.gmail.com>

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/



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