Skip to contents

Plot a cobweb digram of a discrete population growth model

Usage

plot_discrete_population_cobweb(sim_df, params_vec, model_type)

Arguments

sim_df

data frame of discrete population growth

params_vec

a vector with entries c(rd = XX and K = YY) describing the parameters used to generate sim_df

model_type

a string: either "discrete_logistic", "beverton_holt", or "ricker"

See also

run_discrete_logistic_model(), run_beverton_holt_model(), run_ricker_model() for functions that generate the sim_df objects plotted by this function

Examples

dl_params <- c(rd = 1.1, K = 1000)
sim_df_dl <- run_discrete_logistic_model(N0 = 1, params = dl_params, time = 100)
plot_discrete_population_cobweb(sim_df_dl, params_vec = dl_params, model_type = "discrete_logistic")
#> Warning: Removed 1 rows containing missing values (geom_segment).
#> Warning: Removed 1 rows containing missing values (geom_segment).

bh_params <- c(rd = 1.1, K = 1000)
sim_df_bh <- run_beverton_holt_model(N0 = 1, params = bh_params, time = 100)
plot_discrete_population_cobweb(sim_df_bh, params_vec = bh_params, model_type = "beverton_holt")
#> Warning: Removed 1 rows containing missing values (geom_segment).
#> Warning: Removed 1 rows containing missing values (geom_segment).

ri_params <- c(rd = 1.1, K = 1000)
sim_df_ri <- run_ricker_model(N0 = 1, params = ri_params, time = 100)
plot_discrete_population_cobweb(sim_df_ri, params_vec = ri_params, model_type = "ricker")
#> Warning: Removed 1 rows containing missing values (geom_segment).
#> Warning: Removed 1 rows containing missing values (geom_segment).