# Create a 3x3 PPM
A <- matrix(c(0,1,2,0.5,0.1,0,0,0.6,0.6), byrow=TRUE, ncol=3)
A
# Create an initial stage structure
initial <- c(1,3,2)
initial
# Project stage-biased dynamics of A over 70 intervals
pr <- project(A,time=70)
pr
plot(pr)
# Select the projection of stage 2 bias
pr[,2]
# Project stage-biased dynamics of standardised A over 30
# intervals and return demographic vectors
pr2 <- project(A, time=30, standard.A=TRUE, return.vec=TRUE)
pr2
plot(pr2)
#Select the projection of stage 2 bias
pr2$N[,2]
# Select the density of stage 3 in bias 2 at time 10
pr2$vec[11,3,2]
# Select the time series of densities of stage 2 in bias 1
pr2$vec[,2,1]
#Select the matrix of population vectors for bias 2
pr2$vec[,,2]
# Project A over 50 intervals using a specified population structure
pr3 <- project(A, vector=initial, time=50)
pr3
plot(pr3)
# Project standardised dynamics of A over 10 intervals using
# standardised initial structure and return demographic vectors
pr4 <- project(A, vector=initial, time=10, standard.vec=TRUE,
standard.A=TRUE, return.vec=TRUE)
pr4
plot(pr4)
# Select the time series for stage 1
pr4$vec[,1]
Run the code above in your browser using DataLab