partial | R Documentation |
Partial functions are useful to define marginal distributions based on additional parameters.
partial(f, ...)
f |
Function in two or more parameters. |
... |
Parameters to be held fixed for function |
This helper function stores passed arguments in a list, and stores this list in the environment of the returned function. Thus, it remembers the arguments that should be held fixed, such that the returned partial function now is a function with fewer arguments.
Function object.
marginal <- partial(function(x, meanx) qnorm(x, meanx), meanx = 2)
marginal(0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.