plot.leslie.matrix: plot.leslie.matrix

Description Usage Arguments Details Value See Also Examples

Description

Plots Leslie matrices and other objects of class "leslie.matrix".

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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 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"

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

eigen.analysis, loop.elas

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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")

Example output



demogR documentation built on May 1, 2019, 10:56 p.m.