ita_temperature_query_api: Load and cache daily temperature data from API

Description Usage Arguments Value

Description

Pull daily temperature data from the Meteostat API. This function uses cacheing: if the 'cache_file' already exists, it pulls the results from file rather than re-querying the API

Usage

1
2
3
4
5
6
7
ita_temperature_query_api(
  model_years,
  api_key,
  prov_latlong,
  cache_file,
  refresh_cache = FALSE
)

Arguments

model_years

Years of data to pull

api_key

API key for querying the Meteostat API

prov_latlong

Table indexing locations to latitute and longitude. Must contain at least the following three fields: - 'location_code': Numeric code identifying location - 'lat': Latitude - 'lon': Longitude

cache_file

File where the pulled data will be cached

refresh_cache

[optional, default FALSE] Should the data be re-pulled even if a cache file exists?

Value

Data.table containing full Meteostat daily API data as well as location code for all available years


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