Learn R Programming

climatehealth (version 1.0.0)

mh_read_and_format_data: Read in and format data - Mental Health

Description

Reads in a CSV file for a daily time series of health and climate data, renames columns and creates stratum for case-crossover analysis.

Usage

mh_read_and_format_data(
  data_path,
  date_col,
  region_col = NULL,
  temperature_col,
  health_outcome_col,
  population_col
)

Value

A list of dataframes with formatted and renamed columns.

Arguments

data_path

Path to a csv file containing a daily time series of data for a particular health outcome and climate variables, which may be disaggregated by region.

date_col

Character. Name of the column in the dataframe that contains the date.

region_col

Character. Name of the column in the dataframe that contains the region names. Defaults to NULL.

temperature_col

Character. Name of the column in the dataframe that contains the temperature column.

health_outcome_col

Character. Name of the column in the dataframe that contains the health outcome count column (e.g. number of deaths, hospital admissions).

population_col

Character. Name of the column in the dataframe that contains the population estimate coloumn.