Last data update: 2014.03.03

R: Prepare HMD data for 'lexis.hmd()'
prepare.hmdR Documentation

Prepare HMD data for lexis.hmd()

Description

prepare.hmd() prepares the raw 'Deaths by Lexis triangles' HMD data for further use by lexis.hmd.

Usage

prepare.hmd(file)

Arguments

file,

the name of the 'Deaths by Lexis triangles' file downloaded from the Human Mortality Database.

Details

This function reads the raw data into R and transforms data to numeric and Date. Furthermore seven columns (upper, x1, x2, x3, y1, y2, y3) that contain the coordinates of the triangles will be added. The age group 110+ will be removed from the data.

Author(s)

Philipp Ottolinger

Examples

library(LexisPlotR)
# Load sample data
path <- system.file("extdata", "Deaths_lexis_sample.txt", package = "LexisPlotR")
deaths.triangles <- prepare.hmd(path)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(LexisPlotR)
Loading required package: ggplot2
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/LexisPlotR/prepare.hmd.Rd_%03d_medium.png", width=480, height=480)
> ### Name: prepare.hmd
> ### Title: Prepare HMD data for 'lexis.hmd()'
> ### Aliases: prepare.hmd
> 
> ### ** Examples
> 
> library(LexisPlotR)
> # Load sample data
> path <- system.file("extdata", "Deaths_lexis_sample.txt", package = "LexisPlotR")
> deaths.triangles <- prepare.hmd(path)
Warning message:
In prepare.hmd(path) : NAs introduced by coercion
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>