Skip to contents

Usage

dist_uniform(min = NULL, max = NULL)

Arguments

min

Lower limit, or NULL as a placeholder.

max

Upper limit, or NULL as a placeholder.

Value

A UniformDistribution object.

Details

Both parameters can be overridden with with_params = list(min = ..., max = ...).

Examples

d_unif <- dist_uniform(min = 0, max = 1)
x <- d_unif$sample(100)
d_emp <- dist_empirical(x)

plot_distributions(
  empirical = d_emp,
  theoretical = d_unif,
  estimated = d_unif,
  with_params = list(
    estimated = inflate_params(
      fitdistrplus::fitdist(x, distr = "unif")$estimate
    )
  ),
  .x = seq(0, 1, length.out = 100)
)
#> Warning: Removed 2 rows containing missing values or values outside the scale range
#> (`geom_line()`).