x <- rweibull(n = 100, shape = 1, scale = 20000)
# Example 1 - Two-parametric straight line:
pop_weibull <- plot_pop(
p_obj = NULL,
x = range(x),
dist_params_tbl = c(log(20000), 1),
distribution = "weibull"
)
# Example 2 - Three-parametric curved line:
x2 <- rweibull(n = 100, shape = 1, scale = 20000) + 5000
pop_weibull_2 <- plot_pop(
p_obj = NULL,
x = x2,
dist_params_tbl = c(log(20000 - 5000), 1, 5000),
distribution = "weibull"
)
# Example 3 - Multiple lines:
pop_weibull_3 <- plot_pop(
p_obj = NULL,
x = x,
dist_params_tbl = data.frame(
p_1 = c(log(20000), log(20000), log(20000)),
p_2 = c(1, 1.5, 2)
),
distribution = "weibull",
plot_method = "ggplot2"
)
# Example 4 - Compare two- and three-parametric distributions:
pop_weibull_4 <- plot_pop(
p_obj = NULL,
x = x,
dist_params_tbl = data.frame(
param_1 = c(log(20000), log(20000)),
param_2 = c(1, 1),
param_3 = c(NA, 2)
),
distribution = "weibull"
)
Run the code above in your browser using DataLab