Description Usage Arguments Examples
Create a copy of a given function where a set of parameters are replaced with values.
1 | function.substitute(f, substitutes)
|
f |
the function |
substitutes |
the arguments to be substituted into the function. |
1 2 3 4 5 6 7 8 9 10 | f <- function(x, pars) pars[1] + pars[2]*(x + pars[3]*x)
f
# function(x, pars) pars[1] + pars[2]*(x + pars[3]*x)
g <- function.substitute(f, list("pars"=c(1, 2, 3)))
g
# function (x)
# 1 + 2 * (x + 3 * x)
h <- function.substitute(f, list("pars"=c(1, 2, 3), "x"=4))
# function ()
# 33
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.