plot.leslie.matrix {demogR} | R Documentation |
Plots Leslie matrices and other objects of class "leslie.matrix".
## S3 method for class 'leslie.matrix': plot(x, y=NULL, ..., main="", sub="", ann=TRUE, xlim=NULL, ylim=NULL, axes=TRUE, col=c("black","grey"), lwd=2, xlab="Age", ylab="Sensitivity", peryear=5 )
x |
demographic projection matrix |
y |
y axis values; NULL |
... |
arguments to be passed to/from other methods |
main |
an overall title for the plot |
sub |
a subtitle for the plot |
ann |
logical; if TRUE, annotate plot |
xlim |
plotting limits for x-axis; if xlim=NULL , range of
x values used |
ylim |
plotting limits for y-axis; if xlim=NULL , range of
y values used |
axes |
logical; if TRUE, draw axes and box |
col |
vector (length 2) of line colors for the plot; default
c("black","grey") |
lwd |
thickness of the plotted lines; default lwd=2 |
peryear |
width of the age-class/projection interval; default peryear=5 |
xlab |
x-axis label; default xlab="Age" |
ylab |
y-axis label; default xlab="Sensitivity" |
Plots the subdiagonal and the first row of an object of class leslie.matrix on common axes. Probably most useful for plotting either eigenvalue sensitivities or elasticities of a projection matrix.
NULL
data(goodman) ven <- with(goodman, life.table(x=age, nKx=ven.nKx, nDx=ven.nDx)) ven.mx <- with(goodman, ven.bx/ven.nKx) A <- leslie.matrix(lx=ven$nLx,mx=ven.mx) ea.ven <- eigen.analysis(A) usa <- with(goodman, life.table(x=age, nKx=usa.nKx, nDx=usa.nDx)) usa.mx <- with(goodman, usa.bx/usa.nKx) B <- leslie.matrix(lx=usa$nLx,mx=usa.mx) ea.usa <- eigen.analysis(B) ## Compare sensitivities for Venezuela and the USA plot(ea.ven$sens, main="Venezuela") plot(ea.usa$sens, main="USA")