read_hmd | R Documentation |
vital
object for use in other functionsread_hmd
reads single-year and single-age data from the Human Mortality Database (HMD
https://www.mortality.org) and constructs a vital
object suitable
for use in other functions. This function uses HMDHFDplus::readHMDweb()
to download the required data. It is designed to handle Deaths, Population,
Exposure, Death Rates and Births. By default, Deaths, Population, Exposure
and Death Rates are downloaded. It is better to handle Births separately as
they are not age-specific.
read_hmd(
country,
username,
password,
variables = c("Deaths", "Exposures", "Population", "Mx")
)
country |
Directory abbreviation from the HMD. For instance, Australia = "AUS". |
username |
HMD username (case-sensitive) |
password |
HMD password (case-sensitive) |
variables |
List of variables to download from the HMD. If the data contains a mixture of age-specific and non-age-specific variables, then the non-age-specific data will be repeated for each age. |
In order to read the data, users are required to create an account with the HMD website (https://www.mortality.org), and obtain a valid username and password.
read_hmd
returns a vital
object combining the downloaded data.
Rob J Hyndman
## Not run:
norway <- read_hmd(
country = "NOR",
username = "Nora.Weigh@mymail.com",
password = "FF!5xeEFa6"
)
norway_births <- read_hmd(
country = "NOR",
username = "Nora.Weigh@mymail.com",
password = "FF!5xeEFa6",
variables = "Births"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.