View source: R/empirical_dist.R
| empirical_dist | R Documentation |
Construct empirical distribution object.
empirical_dist(data)
data |
data to construct empirical distribution from. if matrix or data frame, each row is a joint observation, if a vector, each element is an observation. whatever data is, it must be convertible to a tibble. |
An empirical_dist object.
# Univariate empirical distribution from a vector
ed <- empirical_dist(c(1, 2, 3, 4, 5))
mean(ed)
# Multivariate empirical distribution from a matrix
mat <- matrix(c(1, 2, 3, 4, 5, 6), ncol = 2)
ed_mv <- empirical_dist(mat)
dim(ed_mv)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.