Re: [Rd] possible bug in formals

2010-05-24 Thread Prof Brian Ripley
On Mon, 24 May 2010, Josef Leydold wrote: Dear Brian and Uwe, Thanks a lot for the clarification. I made the naive assumption that numeric constants in R are similar to those in C. Two questions still remain: (1) when I have a function f<- function(a=1,b=-1) { a+b } is it safe to use

Re: [Rd] possible bug in formals

2010-05-24 Thread Josef Leydold
Dear Brian and Uwe, Thanks a lot for the clarification. I made the naive assumption that numeric constants in R are similar to those in C. Two questions still remain: (1) when I have a function f<- function(a=1,b=-1) { a+b } is it safe to use val <- as.character(deparse(formals

Re: [Rd] possible bug in formals

2010-05-23 Thread Uwe Ligges
On 23.05.2010 16:14, Josef Leydold wrote: Hi, I am a little bit surprised by the following output of 'formals'. Is this the intended behavior? f<- function(a=1,b=-1) { a+b } class(formals(f)$a) [1] "numeric" class(formals(f)$b) [1] "call" Josef Yes, the arguments have not yet been

[Rd] possible bug in formals

2010-05-23 Thread Josef Leydold
Hi, I am a little bit surprised by the following output of 'formals'. Is this the intended behavior? > f <- function(a=1,b=-1) { a+b } > class(formals(f)$a) [1] "numeric" > class(formals(f)$b) [1] "call" Josef -- -