Learn R Programming

climatehealth (version 1.0.0)

read_and_format_data: Code for producing analysis for health effects of extreme weather events - wildfires Read in and format health data

Description

Reads in a CSV file for a daily time series of health and climate data, renames columns to standard names. Creates columns for day of week, month, and year columns derived from the date.

Usage

read_and_format_data(
  health_path,
  date_col,
  mean_temperature_col,
  health_outcome_col,
  population_col = NULL,
  region_col = NULL,
  rh_col = NULL,
  wind_speed_col = NULL
)

Value

Dataframe with formatted and renamed columns

Arguments

health_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. Date column should be in YYYY-MM-DD or YYYY/MM/DD format.

mean_temperature_col

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

health_outcome_col

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

population_col

Character. Name of the column in the dataframe that contains the population data. Defaults to NULL. If omitted, a pop column is used when present.

region_col

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

rh_col

Character. Name of the column in the dataframe that contains daily relative humidity values. Defaults to NULL.

wind_speed_col

Character. Name of the column in the dataframe that contains daily wind speed. Defaults to NULL.