#========================================================= # Figure 6.1. # R script to calculate and plot age class sizes through # time for an age-structured wildlife population, using # projection equations. Demographic rates for the # Northern Spotted Owl are from Noon and Biles # (Journal of Wildlife Management, 1990). #========================================================= num.times=20 p0=.11 # Age-specific survival and fecundity rates. p1=.71 # p2=.94 # f=.24 # J.t=numeric(num.times) # Vector for juveniles. S.t=J.t # Vector for subadults. A.t=J.t # Vector for adults. J.t[1]=1200 # Initial age class sizes. S.t[1]=800 # A.t[1]=2000 # for (i in 1:(num.times-1)) { J.t[i+1]=f*A.t[i] # Recursion equations S.t[i+1]=p0*J.t[i] # for projection of A.t[i+1]=p1*S.t[i]+p2*A.t[i] # age classes. } J.t # Print the results to the console. S.t # A.t # # Plot the age classes through time. time.t=0:(num.times-1) plot(time.t,J.t,type="l",lty=2,xlab="time in years", ylab="population size",ylim=c(0,2600)) points(time.t,S.t,type="l",lty=5) points(time.t,A.t,type="l",lty=1)