ReadHMD | R Documentation |
Download detailed mortality and population data for different countries and regions in a single object from the Human Mortality Database.
ReadHMD(
what,
countries = NULL,
interval = "1x1",
username,
password,
save = FALSE,
show = TRUE
)
what |
What type of data are you looking for? The following options might be available for some or all the countries and regions:
|
countries |
Specify the country data you want to download by adding the
HMD country code/s. Options:
|
interval |
Datasets are given in various age and time formats based on which the records are agregated. Interval options:
|
username |
Your HMD username. If you don't have one you can sign up for free on the Human Mortality Database website. |
password |
Your HMD password. |
save |
Do you want to save a copy of the dataset on your local machine?
Logical. Default: |
show |
Choose whether to display a progress bar. Logical.
Default: |
The Human Mortality Database (HMD) was created to provide detailed mortality and population data to researchers, students, journalists, policy analysts, and others interested in the history of human longevity. The project began as an outgrowth of earlier projects in the Department of Demography at the University of California, Berkeley, USA, and at the Max Planck Institute for Demographic Research in Rostock, Germany (see history). It is the work of two teams of researchers in the USA and Germany (see research teams), with the help of financial backers and scientific collaborators from around the world (see acknowledgements). The Center on the Economics and Development of Aging (CEDA) French Institute for Demographic Studies (INED) has also supported the further development of the database in recent years.
A ReadHMD
object that contains:
input |
List with the input values (except the password). |
data |
Data downloaded from HMD. |
download.date |
Time stamp. |
years |
Numerical vector with the years covered in the data. |
ages |
Numerical vector with ages covered in the data. |
Marius D. Pascariu
## Not run:
# Download demographic data for 3 countries in 1x1 format
age_int <- 1 # age interval: 1,5
year_int <- 1 # year interval: 1,5,10
interval <- paste0(age_int, "x", year_int) # --> 1x1
# And the 3 countries: Sweden Denmark and USA. We have to use the HMD codes
cntr <- c('SWE', 'DNK', 'USA')
# Download death counts. We don't want to export data outside R.
HMD_Dx <- ReadHMD(what = "Dx",
countries = cntr,
interval = interval,
username = "user@email.com",
password = "password",
save = FALSE)
ls(HMD_Dx)
HMD_Dx
# Download life tables for female population and export data.
LTF <- ReadHMD(what = "LT_f",
countries = cntr,
interval = interval,
username = "user@email.com",
password = "password",
save = TRUE)
LTF
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.