Hi everyone,

I have a two part population lab in my Ecology course. The first part was
showing exponential and logistic growth. For the second section, I would
like to introduce them to Leslie/Lefkovitch models. I'm able to multiply
the matrix and the age classes step by step but I would like to have them
run projections for as many generations as they choose and show the
population structure by plotting the number in each age class over time.

I know software programs like Populus do this but I would like to have them
(and myself) learn the programming.

Here's what I have so far:

#the data
A <- c(0,0,100, 0.4,0,0, 0,0.7,0)
#create a matrix from the data
L <- matrix(A, nrow=3, byrow=T)
#check out the matrix
L
#the starting  population
n_0 <- c(1000, 400, 100)
#the next generation
n_1 <- L %*% n_0
#check it out
n_1
#run another generation
n_2 <- L %*% n_1
#check it out
n_2


Many thanks,

Jeff
-- 
********************************************************
Jeffrey A. Stratford, PhD
Department of Biology and Health Sciences
Wilkes University, PA 18766 USA
570-332-2942
http://web.wilkes.edu/jeffrey.stratford/
********************************************************

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

Reply via email to