Re: [R] "recursive default argument" error

2010-03-16 Thread Worik R
I do not understand this. I have the same problem and I tried to reproduce it thusly Q <- 3 test <- function(q=Q){ cat(q, "\n") } > test() 3 Q <- 3 test <- function(q=Q){ test2(q, "\n") } test2 <- function(q, a){ cat(q, a) } > test() 3 Q <- 3 test <- function(q=Q){ z <- paste(q, "\n")

Re: [R] "recursive default argument" error

2008-11-25 Thread tolga . i . uzuner
Many thanks Wacek, that is very helpful. Appreciate it. Regards, Tolga Wacek Kusnierczyk <[EMAIL PROTECTED]> 25/11/2008 10:51 To [EMAIL PROTECTED] cc R help <[EMAIL PROTECTED]> Subject Re: [R] "recursive default argument" error [EMAIL PROTECTED] wrote: > D

Re: [R] "recursive default argument" error

2008-11-25 Thread Wacek Kusnierczyk
[EMAIL PROTECTED] wrote: > Dear R Users, > > I have a function foo in a script with default values for some of the > parameters as follows: > > testparams=list(a=1,b=2,c=3) > foo<-function(x,y,testparams=testparams) > x+y+testparams$a+testparams$b+testparams$c > > > When I try to run foo(1

[R] "recursive default argument" error

2008-11-25 Thread tolga . i . uzuner
Dear R Users, I have a function foo in a script with default values for some of the parameters as follows: testparams=list(a=1,b=2,c=3) foo<-function(x,y,testparams=testparams) x+y+testparams$a+testparams$b+testparams$c When I try to run foo(1,2), I get the following error: > testpara