View source: R/WeatherReading.R
weather_reading | R Documentation |
This functions calls upon the weather reading API from data.gov.sg and returns a list containing the air temperature, rainfall, relative humidity, wind direction and speed across Singapore. Data is updated every 5 minutes for the rainfall API, and every half minute for the other 4 API from NEA.
weather_reading(date_time = "", simplify = FALSE)
date_time |
Defaults to current (SGD) time. Format: YYYY-MM-DDTHH:MM:SS |
simplify |
Defaults to FALSE. Otherwise, simplify = TRUE would return a data frame where all 5 metrics are joined according to weather stations, but return several NAs, as most weather stations collect rainfall data only. |
This API takes slighlty longer than the other APIs in the package as 5 APIs are wrapped within this function.
A dataframe containing various weather readings from weather stations
weather_reading()
weather_reading(date = "2019-11-08T17:30:00")
weather_reading(date = "2018-01-04T09:16:17", simplify = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.