LT1-class {eoR} | R Documentation |
LT1 class for HMD life-tables 1x1
Description
The class LT1
stores HMD life table information in a systematic way.
The header
-method gets the raw header information of an LT1 object
The lt1
-method gets the life table information of an LT1 object
The content
-method gets the life table information of an LT1 object
The region
-method gets the regional information of an LT1 object
The protocol
-method gets the protocol information of an LT1 object
The LTable1
-constructor creates an LT1 object
The length
-method gets the number of rows int the LT1 lt1 data.table
The selectYears
-method gets a subset of an LT1 object
The readLT1x1
-method reads all information from the file 1x1 period life table
Usage
## S4 method for signature 'LT1'
header(object)
## S4 method for signature 'LT1'
lt1(object)
## S4 method for signature 'LT1'
content(object)
## S4 method for signature 'LT1'
region(object)
## S4 method for signature 'LT1'
protocol(object)
LTable1(header, lt1, content, region, protocol)
## S4 method for signature 'LT1'
length(x)
## S4 method for signature 'LT1'
show(object)
## S4 method for signature 'LT1'
selectYears(object, selectYears)
readLT1x1(infile)
Arguments
object |
LT1-object |
header |
vector |
lt1 |
data.table |
content |
character |
region |
character |
protocol |
character |
x |
LT1-object |
selectYears |
vector |
infile |
character file name |
Details
This LT1
class fits to Human Mortality Database (HMD) 1x1 period life tables.
See https://www.mortality.org/ for data details.
An LT1 instance stores the raw header, the content,
the version protocol and regional information and the
life table as a data.table object.
The validation adds a pure numeric age AgeLow to the life table.
Try demo(LT1) for a demonstration.
Value
The header
-method returns the raw header information
The lt1
-method returns the life-table
The content
-method returns the content information
The region
-method returns the regional information
The protocol
-method returns the protocol information
The LTable1
-constructor returns an LT1 object
The length
-method returns the number of rows
The selectYears
-method returns an LT1 object
The readLT1x1
-method returns an LT1 object
Slots
content
describes the content
region
regional entity
header
includes the raw header information
lt1
stores the life table (data.table)
protocol
contains the protocol information
Examples
o1 <- readLT1x1(file.path(system.file(package="eoR"), "extdata", "DEUTNP.fltper_1x1m.txt"))
header(o1)
lt1(o1)[, table(Year)]