plot.HMDdata {MortalitySmooth} | R Documentation |
Plot one or two-dimensional mortality data from a HMDdata
object created by selectHMDdata
.
## S3 method for class 'HMDdata' ## S3 method for class 'HMDdata': plot(x, ...)
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. |
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.
None. Function produces a plot.
Carlo G Camarda
## plot.HMDdata data(HMDdata) # 1-D plot popDENf <- selectHMDdata("Denmark", "Population", "Females", 50:100, 2000) plot(popDENf, main="Danish female population, 2000", xlab="ages") 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")