Learn R Programming

climatehealth (version 1.0.0)

load_and_process_climatedata: Read in and format climate data

Description

Read in a monthly time series of climate data, rename columns and create lag variable for spatiotemporal and DLNM analysis. The climate data should start a year before a start year in the health data to allow the lag variables calculation.

Usage

load_and_process_climatedata(
  climate_data_path,
  district_col,
  year_col,
  month_col,
  tmin_col,
  tmean_col,
  tmax_col,
  rainfall_col,
  r_humidity_col,
  runoff_col = NULL,
  ndvi_col = NULL,
  spi_col = NULL,
  max_lag
)

Value

climate dataframe with formatted and renamed columns, and the lag variables

Arguments

climate_data_path

Path to a csv file containing a monthly time series of data for climate variables, which may be disaggregated by district.

district_col

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

year_col

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

month_col

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

tmin_col

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

tmean_col

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

tmax_col

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

rainfall_col

Character. Name of the column in the dataframe that contains the cumulative monthly rainfall.

r_humidity_col

Character. Name of the column in the dataframe that contains the relative humidity.

runoff_col

Character. Name of the column in the dataframe that contains the monthly runoff water data. Defaults to NULL.

ndvi_col

Character. Name of column containing the Normalized Difference Vegetation Index (ndvi) data. Defaults to NULL.

spi_col

Character. Name of the column in the dataframe that contains the standardized precipitation index. Defaults to NULL.

max_lag

Character. Number corresponding to the maximum lag to be considered for the delay effect. It should be between 2 an 4. Defaults to 4.