Learn R Programming

mortSOA (version 0.1.0)

read_mort_soa: Read data from mort.soa.org and return a list of data frames

Description

Read data from mort.soa.org and return a list of data frames

Usage

read_mort_soa(table_id)

Value

A list containing any tables associated with table_id plus the metadata attributes described above. Individual tables are data frames (tibbles).

Arguments

table_id

An identification number for a mortality table on <mort.soa.org>

Details

This function first checks if the provided table_id is available on mort.soa.org. If not found, an error is returned.

If a match is found, a list containing all tables underneath table_id is returned. The list contains several attributes that can be queried using attr({list}, "{attribute}). Available attributes include:

  • name - Name of the table

  • table_id

  • description - A detailed description of the table

  • usage - Intended usage

  • layout - Table layout

  • nation - Nation of origin

  • sub_descriptions - A character vector containing detailed descriptions for each sub-table underneath table_id

Most tables have either an "Aggregate" or "Select and Ultimate" structure.

  • Aggregate structures contains a single table with one dimension (usually Age).

  • Select and Ultimate structures contain two tables. The first table contains two dimensions for Age and Duration. The second table contains a single dimension for Age.

For convenience, any two-dimensional tables are pivoted longer into a "tidy" format with 3 columns: Age, Duration, and the mortality (or other) rate.

References

Society of Actuaries Mortality and Other Rate Tables https://mort.soa.org

See Also

filter_inventory()

Examples

Run this code
# Get table #2586: 2012 IAM Period Table – Female, ANB
read_mort_soa(2586)

Run the code above in your browser using DataLab