Skip to contents

This function generates Table 5.2, which shows deaths by place of usual residence and the sex of the deceased.

Usage

create_t5.2(
  data,
  date_var = "dodyr",
  data_year = NA,
  tablename = "Table_5_2",
  output_path = NULL
)

Arguments

data

Death records data frame.

date_var

Event year column of the dataframe. Defaults to "dodyr".

data_year

The year to report on. Defaults to the last in the data.

tablename

Name of the table to be saved as a csv file. Optional.

output_path

The path to export the generated csv table. Optional.

Value

A data frame of tabulated results

Details

Variables needed per record:

- `dodyr`: Year of death.

- `death2o`: Region of usual residence.

- `death2c`: Sex of the deceased.

Examples

death_data <- construct_sample_death_data()
death_data <- construct_year(death_data, date_col = "death1a", year_col = "dodyr")
table_5_2 <- create_t5.2(death_data, date_var="dodyr", data_year = 2022)