plot.HMDdata: Plot age and year specific demographic data

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Plot one or two-dimensional mortality data from a HMDdata object created by selectHMDdata.

Usage

1
2
## S3 method for class 'HMDdata'
plot(x, ...)

Arguments

x

a HMDdata object.

...

other plotting parameters. Either passed to plot in a one-dimensional plot or passed to levelplot in a two-dimensional surface.

Details

The function needs HMDdata to be uploaded.

A HMDdata object can be produced by selectHMDdata.

The function recognizes the HMDdata object, its dimensions and its attributes (country, type of data and sex). Given the dimensions of the object the function plot either a simple unidimensional plot or a more complex shaded contour map over age and years.

Note that rates are automatically plotted in log-scale.

Value

None. Function produces a plot.

Author(s)

Carlo G Camarda

See Also

HMDdata, selectHMDdata.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## 1-D plot
popDENf <- selectHMDdata("Denmark", "Population",
                         "Females", 50:100, 2000) 
plot(popDENf, main="Danish female population, 2000",
     xlab="ages", pch=2, col=2)
ratDENf <- selectHMDdata("Denmark", "Rates",
                         "Females", 50:100, 2000)
plot(ratDENf, main="Danish female log death rates, 2000",
     xlab="ages")

## 2-D plot
years <- 1950:2000
ages <- 0:100
popJAPf <- selectHMDdata("Japan", "Population", "Females",
                         ages, years)
plot(popJAPf, main="Japanese female population")
ratSWEf <- selectHMDdata("Sweden", "Rates", "Females")
plot(ratSWEf, main="Swedish female log death rates")

MortalitySmooth documentation built on May 2, 2019, 6:07 a.m.