ita_prepare_covar_temperature: Prepare covariate: weekly temperature

Description Usage Arguments Value

Description

Covariate-specific prep function for average experienced weekly temperature by province. Note that this function uses cacheing, so if the raw data has been pulled from the API already it will not be re-pulled

Usage

1
2
3
4
5
6
7
8
ita_prepare_covar_temperature(
  covar_fp,
  model_years,
  location_table,
  pop_raster,
  polys_sf,
  final_obs_week
)

Arguments

covar_fp

Filepath to an API key for Meteostat, which will be used to pull weekly templerature data

model_years

Vector of years to consider for modeling

location_table

Location code merge table for Italy

pop_raster

[optional] Population rasterBrick object, with one layer per modeling year. Only used to prepare raster covariates, default NULL.

polys_sf

[optional] Polygon boundaries

final_obs_week

ID for the final observed week in 2020, formatted as an integer between 1 and 52 inclusive.

Value

A list of two items: - "prepped_covar": data.table containing the prepped covariate - "covar_indices": Vector of identifiers that should be used to merge onto the modeling dataset. The prepared covariate dataset should only include identifier columns and the covariate value, specified by the covariate name


njhenry/covidemr documentation built on Feb. 2, 2022, 2:31 a.m.