plot.leslie.matrix {demogR} | R Documentation |
plot.leslie.matrix
Description
Plots Leslie matrices and other objects of class "leslie.matrix".
Usage
## 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 )
Arguments
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 |
ylim |
plotting limits for y-axis; if |
axes |
logical; if TRUE, draw axes and box |
col |
vector (length 2) of line colors for the plot; default
|
lwd |
thickness of the plotted lines; default |
peryear |
width of the age-class/projection interval; default |
xlab |
x-axis label; default |
ylab |
y-axis label; default |
Details
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.
Value
NULL
See Also
Examples
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")