get_pollution_history: Returns a dataframe of pollution history for a location...

Description Usage Arguments Details Value Examples

View source: R/get_pollution_history.R

Description

Given a specified date range, the function makes an API request to the OpenWeather Air Pollution API and fetches historic pollution data for a given location.

Usage

1
get_pollution_history(start_date, end_date, lat, lon, api_key)

Arguments

start_date

The start date as a UNIX timestamp, e.g. 1606488670

end_date

The end date as a UNIX timestamp, e.g. 1606747870

lat

Latitude coordinate for a given location as a double

lon

Longitude coordinate for a given location as a double

api_key

The API key for OpenWeather as a string

Details

Note: Historical data is accessible from 27th November 2020

Value

data frame containing pollution history

Examples

1
get_pollution_history(1606488670, 1606747870, 49.28, 123.12, "APIKEY_example")

UBC-MDS/rpollution documentation built on Feb. 7, 2022, 9:12 a.m.