get_air_pollution.Rd
The function makes an API request to the OpenWeather Air Pollution API and fetches pollution data for a given location, then transforms the returned JSON object from the request into a ggplot chart.
get_air_pollution(lat, lon, api_key, fig_title = "")
Latitude for a given location as a double
Longitude for a given location as a double
The API key for OpenWeather as a string
The title of the returned ggplot as a string
plotly object
get_air_pollution(49.28, 123.12, "APIKEY_example", "example title")
#> [1] "An error occurred fetching data from the API"