station_code: A character string or factor from get_stations_metadata() of the BOM station code for the station of interest.
start_date_time: A character string representing the start date and time of the query in the format yyyy-mm-dd-hh-mm (ISO8601). Defaults to 24 hours before the current local system time, returning the most recent 24 hour observations rounded to the nearest minute. This function does its best to decipher many date and time formats but prefers ISO8601.
minutes: An integer value that provides the number of observations to be returned. Defaults to 1440 minutes for 24 hours of observations.
values: A vector of weather values to query from the API . See Available Values section for valid available codes. Defaults to all available values, all.
api_key: A character string containing your API key from DPIRD , https://www.dpird.wa.gov.au/online-tools/apis/, for the DPIRD Weather 2.0 API . Defaults to automatically detecting your key from your local .Renviron, .Rprofile or similar. Alternatively, you may directly provide your key as a string here. If nothing is provided, you will be prompted on how to set up your session so that it is auto-detected.
Returns
a data.table::data.table() with station_code and the date interval queried together with the requested weather variables.
Note
Please note this function converts date-time columns from Coordinated Universal Time UTC returned by the API to Australian Western Standard Time AWST .
Available Values
all (which will return all of the following values),
airTemperature,
dateTime,
dewPoint,
rainfall,
relativeHumidity,
soilTemperature,
solarIrradiance,
wetBulb,
wind,
windAvgSpeed,
windMaxSpeed, and
windMinSpeed
Examples
## Not run:# Note that you need to supply your own API keyget_dpird_minute( station_code ="SP", start_date_time ="2023-02-01 13:00:00", minutes =1440, values = c("airTemperature","solarIrradiance","wind"), api_key ="your_api_key")## End(Not run)