curry_v1 | R Documentation |
To curry a function means to pre-evaluate some of the arguments
So, if you have a function
sum <- function(a, b) {a + b}
And you always want b
to be 1, you could define
add.one <- curry(sum, b = 1)
Which is the same as
function(a) {a + 1}
curry_v1(FUN, ...)
FUN |
the function we are currying |
... |
the arguments you want to pre-evaluate |
the new curried function
sum <- function(a, b) {a + b}
add.one <- curry(sum, b = 1)
function(a) {a + 1}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.