Skip to content
Prev 59926 / 398502 Next

Arguments matching

I have the answer using match.call:



multxby2 <- function(callf) {

     appel1<-match.call()

     appel<-as.list(match.call(eval(appel1$callf[[1]]),call=as.call(appel1$callf)))
     print(appel)

     px<-pmatch(names(appel),"xx")

     if(sum(is.na(px))!=length(appel)) print(appel[[which(!is.na(px))]]*2)
     # else ...

}

f1=function(x=2,y=3){}

multxby2(f1(x=3))
At 16:58 26/11/2004, Stephane DRAY wrote:
St??phane DRAY
-------------------------------------------------------------------------------------------------- 

D??partement des Sciences Biologiques
Universit?? de Montr??al, C.P. 6128, succursale centre-ville
Montr??al, Qu??bec H3C 3J7, Canada

Tel : (514) 343-6111 poste 1233         Fax : (514) 343-2293
E-mail : stephane.dray at umontreal.ca
-------------------------------------------------------------------------------------------------- 

Web                                          http://www.steph280.freesurf.fr/