plotCobweb: Cobweb plots for logistic, Ricker, Gompertz, or...

View source: R/plotCobweb.R

plotCobwebR Documentation

Cobweb plots for logistic, Ricker, Gompertz, or theta-logistic models.

Description

Cobweb plots for logistic, Ricker, Gompertz, or theta-logistic models.

Usage

plotCobweb(modeloutput, modelname, modelpars, viewcode = FALSE)

Arguments

modeloutput

an array of population sizes at time "t" generated by a discrete time model. Equivalent to "output" used in Section 14.1.2

modelname

character string indicating model used: "logistic", "ricker", "gompertz", "theta-logistic"

modelpars

a list containing model parameters. For logistic, this will be list(r = r, K = K). For ricker, use list(alphal = alphal, K = K). For gompertz, use list(b = b, K = K). For theta-logistic, use list(r = r, K = K, theta = theta)

viewcode

TRUE or FALSE (default) indicating whether to print the function code

Value

a cobweb plot in the figure window

Examples


#Logistic Equation:
r <- 1.5
K <- 100
N0 <- 10
tmax <- 50
years <- 0:tmax
output <- rep(x = NA, times = length(years))
output[1] <- N0
n.loop <- length(years)
for (i in 2:n.loop) {
  n.t <- output[i-1]
  n.t.plus.1 <- n.t + r * n.t * (1 - n.t / K)
  output[i] <- n.t.plus.1
}
plotCobweb(modeloutput = output, modelpars = list(r = r, K = K), modelname = "logistic")




tessington/quantecol documentation built on June 1, 2025, 9:06 p.m.