Re: [R] Problems with passing ... to a function

From: Ales Ziberna <>
Date: Thu 22 Dec 2005 - 21:26:49 EST

Thanks to the helpful R-hlep-er, the problem has been solved. 'm' was matching 'maxiter'.

Thanks again,
Ales Ziberna

Dear useRs!

I have written a function that should pass argument "m" to the next function, however it does not! Please have a look at the function below that shows a problem and tell me what I am missing. As you can see, the "blocks" argument is passed corectly, while "m" is not.


Ales Ziberna<-function(
 #function for optimizig partition in blockmodeling  M, #matrix
 clu, #initial partition
 maxiter=50, #maximum number of iterations  trace.iter=FALSE, #save a result of each iteration or only the best (minimal error)
 switch.names=is.null(BLOCKS), #should partitions that only differ in group names be considert equal (is c(1,1,2)==c(2,2,1))  save.initial.param=TRUE, #should the initial parameters be saved  approach,
 ... #other arguments to called functions - to '' ){

 if(save.initial.param)initial.param<-tryCatch(lapply(as.list(sys.frame(sys.nframe())),eval),error=function(...)return("error"))#savesthe inital parameters f<-function(blocks,...)(print(blocks)) f(...)f<-function(m,...)(print(m))f(...)},m=1,clu=rep(1:2,times=c(7,8)),blocks=c("null","reg"),approach="val") mailing list PLEASE do read the posting guide! Received on Thu Dec 22 21:32:30 2005

This archive was generated by hypermail 2.1.8 : Thu 22 Dec 2005 - 23:42:28 EST