Learn R Programming

datagovsgR (version 0.3.0)

weather_forecast: Weather Forecast

Description

This functions calls upon the weather forecast API from data.gov.sg and returns a data frame containing different metrics of the forecast. 2-hour, 24-hour and 4-day forecasts are availible. This data provided by the API is updated half-hourly.

Usage

weather_forecast(date_time = "", forecast = "2-hour")

Arguments

date_time

Defaults to current (SGD) time. Format: YYYY-MM-DDTHH:MM:SS

forecast

Defaults to "2-hour". Also availible for "24-hour" and "4-day"

Value

A dataframe the forecast for a given date and time, and forecast period.

Examples

Run this code
# NOT RUN {
weather_forecast()
weather_forecast(date = "2019-11-08T17:30:00", forecast = "24-hour")
weather_forecast(date = "2018-01-04T09:16:17", forecast = "4-day")
# }

Run the code above in your browser using DataLab