| draws_fun | R Documentation |
Summarise the distribution of random draws in an rvec, using a function.
draws_fun(x, fun, ...)
## S3 method for class 'rvec'
draws_fun(x, fun, ...)
x |
An object of class rvec. |
fun |
A function. |
... |
Additional arguments passed to |
The results from calls to fun,
combined using vctrs::vec_c().
Apply pre-specified functions across draws:
draws_all()
draws_any()
draws_min()
draws_max()
draws_median()
draws_mean()
draws_mode()
draws_sd()
draws_var()
draws_cv()
draws_ci()
draws_quantile()
set.seed(0)
m <- rbind(a = rnorm(100, mean = 5, sd = 2),
b = rnorm(100, mean = -3, sd = 3),
c = rnorm(100, mean = 0, sd = 20))
x <- rvec(m)
x
draws_fun(x, fun = mad)
draws_fun(x, fun = range)
draws_fun(x, weighted.mean, wt = runif(100))
draws_fun(x, function(x) sd(x) / mean(x))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.