Performs an API request to OpenWeather Air Pollution API, retrieves weather forecast for the next 5 days, and creates a time series graph of the pollutants with their concentration levels.

get_pollution_forecast(lat, lon, api_key)

Arguments

lat

A double type containing geographical latitude coordinate for the location

lon

A double type containing geographical longitude coordinate for the location

api_key

A character type OpenWeather API key

Value

A ggplot object

Examples

get_pollution_forecast(50, 50, "APIKEY_example")
#> [1] "An error occurred fetching data from the API"