
Simulate Coral Colony Sizes Using Skewed Distributions
simulate_coralsize.RdThis function simulates coral colony sizes per species using either a log-normal
(rlnorm) or gamma (rgamma) distribution, based on the observed mean and standard
deviation of colony widths in the input data. Each species will be sampled ndraws times.
Usage
simulate_coralsize(
input = coralsize,
distribution = "rlnorm",
ndraws,
plot = FALSE,
seed = NULL
)Arguments
- input
A data frame with columns
speciesandwidth. Default iscoralsize.- distribution
Character string. Distribution type to simulate from. Supported options are
"rlnorm"and"gamma".- ndraws
Integer. Number of simulated coral sizes per species.
- plot
Logical. If
TRUE, a histogram of simulated sizes is plotted by species.- seed
Optional integer. If provided, sets the random seed for reproducibility.