Empty / NULL distribution
dst_null.Rd
Sometimes it's convenient to work with a distribution object that is empty,
akin to a NULL
value. This is especially true when programmatically
outputting distributions, such as when a distribution fails to fit to
data. This contructor makes such a distribution object. It always evaluates
to an NA
vector.
Examples
x <- dst_null()
mean(x)
#> [1] NA
eval_pmf(x, at = 1:10)
#> [1] NA NA NA NA NA NA NA NA NA NA
enframe_hazard(x, at = 1:10)
#> # A tibble: 10 × 2
#> .arg hazard
#> <int> <dbl>
#> 1 1 NA
#> 2 2 NA
#> 3 3 NA
#> 4 4 NA
#> 5 5 NA
#> 6 6 NA
#> 7 7 NA
#> 8 8 NA
#> 9 9 NA
#> 10 10 NA