Re: [Rd] How to debug an R package (with C code)

2014-01-19 Thread Davor Cubranic
I’m not sure what’s going on with your setup, but this is what I get on my machine when I press Ctrl-C just after the R prompt comes up when started with “R -d gdb": Program received signal SIGINT, Interrupt. 0x7fff874179aa in select$DARWIN_EXTSN () (gdb) bt #0 0x7fff874179aa in s

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

2014-01-19 Thread baptiste auguie
Thank you Peter and Duncan, for the explanation and discussion. As for a workaround, I think it is more readable to define, test <- function(a = complex(real=1, imaginary=2)){} Best regards, baptiste On 19 January 2014 18:45, Duncan Murdoch wrote: > On 14-01-19 4:16 PM, peter dalgaard wrote

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

2014-01-19 Thread Duncan Murdoch
On 14-01-19 4:45 PM, Duncan Murdoch wrote: On 14-01-19 4:16 PM, peter dalgaard 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 c

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

2014-01-19 Thread Duncan Murdoch
On 14-01-19 4:16 PM, peter dalgaard 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+2

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

2014-01-19 Thread peter dalgaard
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 compl

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

2014-01-19 Thread baptiste auguie
Dear list, I'm facing an issue with the automated documentation of a function using roxygen2. The function has a complex-valued default argument, which is picked up by roxygen2 using formals() to generate the corresponding Usage section of the Rd file. Unfortunately, it appears that formals() refo

Re: [Rd] How to debug an R package (with C code)

2014-01-19 Thread Gábor Csárdi
On Sun, Jan 19, 2014 at 1:53 PM, Davor Cubranic wrote: > On Jan 17, 2014, at 6:17 AM, Gábor Csárdi wrote: > > > Small note: if you are using a recent version of OSX, then gdb is > > essentially useless, but you can use llvm, which is nicer in many > respects, > > anyway. > > > What do you mean by

Re: [Rd] How to debug an R package (with C code)

2014-01-19 Thread Davor Cubranic
On Jan 17, 2014, at 6:17 AM, Gábor Csárdi wrote: > Small note: if you are using a recent version of OSX, then gdb is > essentially useless, but you can use llvm, which is nicer in many respects, > anyway. What do you mean by this? Gdb is a debugger, and LLVM is a compiler infrastructure. Perha

Re: [Rd] rexp, different results on 32/64 bit

2014-01-19 Thread Gábor Csárdi
On Sun, Jan 19, 2014 at 2:45 AM, Prof Brian Ripley wrote: > On 17/01/2014 18:58, Gábor Csárdi wrote: > >> Hi all, >> >> I just run into this today. Apparently rexp() sometimes gives different >> slightly results for the same seed on 32 bit and 64 bit machines. runif() >> is the same for both, so t