dlvcomp2 {primer} | R Documentation |
A function to simulate discrete 2 species Lotka-Volterra growth.
dlvcomp2(N, alpha, rd = c(1, 1))
N |
a vector of length two, containing N[t] for both species. |
alpha |
a 2 x 2 matrix of the magnitudes of the per capita (negative) effects (i.e., positive value results in a negative effect). |
rd |
a vector of length 2 containing the discrete growth increments for 2 species. |
Returns a vector of length 2, containing N[t+1] for both species.
Hank Stevens (HStevens@muohio.edu)
Stevens. M.H.H. 2009. A Primer of Ecology with R. Use R! Series. Springer.
alphs <- matrix(c( .01, .005, .008, .01), ncol=2, byrow=TRUE) t <- 20 N <- matrix(NA, nrow=t+1, ncol=2) N[1,] <- c(10,10) for(i in 1:t) N[i+1,] <- dlvcomp2(N[i,], alphs) matplot(0:t, N, type='l', col=1, ylim=c(0,110)) abline(h=1/alphs[1,1], lty=3) text(0, 1/alphs[1,1], "K", adj=c(0,0)) legend("right", c(expression("Sp.1 "*(alpha[21]==0.008)), expression("Sp.2 "*(alpha[12]==0.005))), lty=1:2, bty='n')