as.function.epiparameter | R Documentation |
as.function()
method for <epiparameter>
classConverts an <epiparameter>
object to a distribution function
(see epiparameter_distribution_functions), either probability density/mass
function, (density
), cumulative distribution function (cdf
), random
number generator (generate
), or quantile (quantile
).
## S3 method for class 'epiparameter'
as.function(x, func_type = c("density", "cdf", "generate", "quantile"), ...)
x |
An |
func_type |
A single |
... |
dots Extra arguments to be passed to the method. |
The function returned takes a single required argument x
.
A function object.
ep <- epiparameter_db(single_epiparameter = TRUE)
# by default it will convert to a density function
f <- as.function(ep)
# use function
f(10)
f <- as.function(ep, func_type = "cdf")
f(10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.