Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 922 Bytes

README.md

File metadata and controls

34 lines (24 loc) · 922 Bytes

openweather

The goal of openweather is to generate a simple interactive weather forecast R shiny page using openweather.org.

The App

Has a simple dropdown box for location; ‘My location’ or a list of Australian city locations. ‘My location’ uses the native HTML5 API on page load.

Once selected, the openweather.org API is called, and the data presented. It uses insertUI/removeUI to add and remove HMTL elements.

Functions

# Call openweather API using lat, lon and OPENWEATHERMAP_API_KEY environmental variable
# returns the JSON response as a list
get_weather_data(lat, lon)
# Take the response list and generate HTML elements for presentation
# return a 'row' of the forecast data (lapply across the resp$list elements)
create_weather_data_row(data)