Description Usage Arguments Value Author(s) See Also Examples
Plot an object of class demogdata
1 2 |
dd.obj |
a mortality type data object of class |
year |
vector of years to be included in the plotting (all available years by default) |
col |
color palette to be used in the plot (by default, it uses a sequence of rainbow colors) |
lpos |
a text identifier (one of "UR", "LR", "UL", "LL", "UC", "LC", "CL", "CR"; whereas the abbreviation is made up by U/L/C=Upper/Lower/Center, L/R/C=Left/Right/Center) or a list containing the coordinates (e.g. x and y) of the upper left corner of the legend/object. |
lpar |
list of additional arguments to be passed on to |
ppar |
logical, if FALSE, ignores in the legend the plotting arguments |
... |
additional plotting arguments that are passed on to both |
Plot of mortality rates or number of deaths.
Zoltan Butt, Steven Haberman and Han Lin Shang
extract.deaths
, plot.demogdata
,
legend
, par
, rainbow
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # plot log mortality rates with repositioned legend
plot_dd(dd.cmi.pens, xlim=c(40, 110), lpar=list(x.intersp=-0.2, y.intersp=0.9, cex=0.85))
# plot (untransformed) mortality rates with repositioned legend
plot_dd(dd.cmi.pens, age=60:95, lpar=list(x.intersp=-0.2, y.intersp=0.9, cex=0.85), transf=FALSE)
# plot a small subset of log mortality rates (calendar years: 1985 - 1995)
# and add a line with the overall mean rates
plot_dd(dd.cmi.pens, lpos=list(x=0.85,y=0.55), year=1985:1995,
lpar=list(x.intersp=-0.1, y.intersp=0.95, cex=0.9))
lines(mean(dd.cmi.pens),lwd=2, lty=3, col='red')
# legend(coord('LC'), legend='mean rate', lwd=2, lty=3, col='red', text.col='red')
# plot number of (extracted) deaths:
tmp.d <- extract.deaths(dd.cmi.pens, ages=55:100, y=1995:2003)
plot_dd(tmp.d, transf=FALSE, lty=1:5, ylab='Number of Deaths',
main=paste(tmp.d$lab, ": male (1995-2003)", sep=''))
|
Loading required package: demography
Loading required package: forecast
This is demography 1.20
Loading required package: rainbow
Loading required package: MASS
Loading required package: pcaPP
Loading required package: date
Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE
3: .onUnload failed in unloadNamespace() for 'rgl', details:
call: fun(...)
error: object 'rgl_quit' not found
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.