[R] Function objects as arguments of a function

Tsumiyama Isao tsumi at leo.auric.ne.jp
Sat May 25 15:59:10 CEST 2002


Hello, R users.

 In C (or C++) language, a function can be used as
an argument of another function as follows:

//  function used as an argument
void foo(int x)
{
    ...
}

// function using a function as an argument
void bar(void (*func)(int ), int arg1, int arg2)
{
    ....
}

//  The function 'bar' will be called as follows
int main()
{
    ....

    bar(foo, arg4foo, other_arg);

    ...
}

In R, can function objects be used as arguments of
a function? 

Thanks in advance from Japan

#####################################
#  Tsumiyama Isao (Mitsubishi Pharma Corp.)
#  Tel:047-471-7721 
#  PHS:070-5659-0544
#  e-mail:tsumi at leo.auric.ne.jp
#           tsumiyama at pdx.ne.jp(PHS)
#####################################
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list