Thank you! That's exactly what I wanted.
--Mog
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-cont
e copying
the function to several different places with the above methods.
Alternately, I could hard-code the partial applications using a
function() form, but I would prefer not to do this, as there will be a
sizable number of these closures needed and I'd prefer to automat
Thanks very much! Works fine now. I'll read up on R's evaluation model.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented,
I realize that the Funcall example with an init parameter will work,
but I'd like to be able to get a one-argument function/closure out of
that reduction, if at all possible. Sorry, I under-specified in my
question.
Thanks!
__
R-help@r-project.org maili
Hi All,
I'd like to be able to specify the ordered composition of several
functions. So I defined compose:
compose <- function(f,g){
function(x){f(g(x))}
}
and some simple test functions:
plus2 <- function(x){x+2}
plus3 <- function(x){x+3}
plus4 <- function(x){x+4}
> (compose(plus2,compose(
5 matches
Mail list logo