station_code: A character string or factor from get_stations_metadata() of the BOM station code for the station of interest.
values: A character string with the type of extreme weather to return. See Available Values for a full list of valid values. Defaults to all, returning the full list of values unless otherwise specified.
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() of one row with station_code, station_name, latitude, longitude, date_time of the query and the extreme weather information according to the value(s) selected.
Available Values
all (which will return all of the following values),
erosionCondition,
erosionConditionLast7Days,
erosionConditionLast7DaysDays,
erosionConditionLast7DaysMinutes,
erosionConditionLast14Days,
erosionConditionLast14DaysDays,
erosionConditionLast14DaysMinutes,
erosionConditionMonthToDate,
erosionConditionMonthToDateDays,
erosionConditionMonthToDateMinutes,
erosionConditionMonthToDateStartTime,
erosionConditionSince12AM,
erosionConditionSince12AMMinutes,
erosionConditionSince12AMStartTime,
erosionConditionYearToDate,
erosionConditionYearToDateDays,
erosionConditionYearToDateMinutes,
erosionConditionYearToDateStartTime,
frostCondition,
frostConditionLast7Days,
frostConditionLast7DaysDays,
frostConditionLast7DaysMinutes,
frostConditionLast14Days,
frostConditionLast14DaysDays,
frostConditionLast14DaysMinutes,
frostConditionMonthToDate,
frostConditionMonthToDateDays,
frostConditionMonthToDateMinutes,
frostConditionMonthToDateStartTime,
frostConditionSince9AM,
frostConditionSince9AMMinutes,
frostConditionSince9AMStartTime,
frostConditionTo9AM,
frostConditionTo9AMMinutes,
frostConditionTo9AMStartTime,
frostConditionYearToDate,
frostConditionYearToDate,
frostConditionYearToDateMinutes,
frostConditionYearToDateStartTime,
heatCondition,
heatConditionLast7Days,
heatConditionLast7DaysDays,
heatConditionLast7DaysMinutes,
heatConditionLast14Days,
heatConditionLast14DaysDays,
heatConditionLast14DaysMinutes,
heatConditionMonthToDate,
heatConditionMonthToDateDays,
heatConditionMonthToDateMinutes,
heatConditionMonthToDateStartTime,
heatConditionSince12AM,
heatConditionSince12AMMinutes,
heatConditionSince12AMStartTime,
heatConditionYearToDate,
heatConditionYearToDateDays,
heatConditionYearToDateMinutes, and
heatConditionYearToDateStartTime
Examples
## Not run:# Query Bonnie Rock station for wind erosion and heat extreme events# Note that you need to supply your own API keyxtreme <- get_dpird_extremes( station_code ="BR", values = c("erosionCondition","heatCondition"), api_key ="your_api_key")## End(Not run)