if (FALSE) {
# using creator function
unifdist <- function(min = 0, max = 1) {
if (!is.numeric(min) || !is.numeric(max)) stop("Parameters must be a numeric")
if (min >= max) stop("min must be smaller than max.")
new_dist(name = "Uniform", from = min, to = max)
}
#directly
U <- new_dist(name = "Uniform", from = 1, to = 6,
parameters = list(min = 1, max = 6), class = "unifdist")
}
Run the code above in your browser using DataLab