View source: R/eval_property.R
eval_property | R Documentation |
Evaluate a distribution property. The distribution itself is first searched for the property, and if it can't be found, will attempt to calculate the property from other entries.
eval_property(distribution, entry, ...)
distribution |
Distribution object. |
entry |
Name of the property, such as "cdf" or "mean". Length 1 character vector. |
... |
If the property is a function, arguments to the function go here. Need not be named; inserted in the order they appear. |
The distribution's property, evaluated. If cannot be
evaluated, returns NULL
.
d <- distribution(cdf = \(x) (x > 0) * pmin(x^2, 1), g = 9.81)
eval_property(d, "g")
eval_property(d, "quantile", 1:9 / 10)
eval_property(d, "mean")
eval_property(d, "realise", 10)
eval_property(d, "foofy")
eval_property(d, "foofy", 1:10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.