get_air_pollution: Returns a map depicting varying pollution levels for a...

Description Usage Arguments Value Examples

View source: R/get_air_pollution.R

Description

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.

Usage

1
get_air_pollution(lat, lon, api_key, fig_title = "")

Arguments

lat

Latitude for a given location as a double

lon

Longitude for a given location as a double

api_key

The API key for OpenWeather as a string

fig_title

The title of the returned ggplot as a string

Value

plotly object

Examples

1
get_air_pollution(49.28, 123.12, "APIKEY_example", "example title")

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