ecostudy-package | R Documentation |
Functions to aid understanding ecological models for Ecology 101 level. The package is designed to support Krebs (2009), but because it covers the most basic models, it probably suits for any other similar textbook. The primary usage was to draw graphics for my basic ecology lectures, but many functions can be used for other teaching or studying purposes.
The package contains basic ecological models for population dynamics of single species and two-species interactions. The models include:
Population growth: logistic model (poplogist
),
stochastic logistic growth (ranlogist
), Ricker model
(ricker
), Milne's stochastic ceiling model
(ranmilne
).
Competition: Lotka-Volterra model (lotkacomp
),
Tilman's resource competition model (tilman
).
Predator–Prey relationship: Lotka-Volterra model in its basic
form (lotkaprey
), and the model with density dependent
prey (lotkapreyK
), Rosenzweig–MacArthur model
(rmprey
).
The functions were originally written to draw graphics for my
lecture slides, and therefore their user interface often is
restricted (contributions are welcome). Most functions work so that
the the basic function sets up the model, plot
draws the zero
isoclines and other static structures but no population
trajectories. The population trajectories can be found with a new S3
generic function traj
in the package, and lines
function normally adds the trajectories to the basic plot.
Most functions are based on the primer package (Stevens 2009),
and even other functions are modelled similarly. The models are set
up as differential equations, and numerical integration is used to
find the trajectories (function ode
of the
deSolve package).
Jari Oksanen <jari.oksanen@oulu.fi>
Maintainer: Jari Oksanen <jari.oksanen@oulu.fi>
Krebs, C. J. (2009) Ecology. Benjamin Cummings. 6 ed., 655 p.
Stevens, M.H.H. (2009) A Primer of Ecology with R. Springer.
primer
.
## A typical usage: Lotka-Volterra competition mod <- lotkacomp(1.2, 1.1, 50, 50) ## The static model mod summary(mod) plot(mod) ## Species trajectories tr <- traj(mod, N1 = 20, N2 = 4, r1 = 0.3, r2 = 1) plot(tr) ## Plot species trajectories plot(mod) lines(mod, N1 = 20, N2 = 4, r1 = 0.2, r2 = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.