get_historical_weather: Obtain historical BOM data

Description Usage Arguments Value Caution dplyr Compatibility Note Author(s) See Also Examples

Description

Retrieves daily observations for a given station.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
get_historical_weather(
  stationid = NULL,
  latlon = NULL,
  radius = NULL,
  type = c("rain", "min", "max", "solar")
)

get_historical(
  stationid = NULL,
  latlon = NULL,
  radius = NULL,
  type = c("rain", "min", "max", "solar")
)

Arguments

stationid

BOM station ‘ID’. See Details.

latlon

Length-2 numeric vector of Latitude/Longitude. See Details.

radius

Numeric value, distance (km) from latlon, must be numeric.

type

Measurement type for daily, either daily “rain”, “min” (temp), “max” (temp), or “solar” (exposure). Partial matching is performed. If not specified returns the first matching type in the order listed. Ignored if hourly or minute are selected for tscale.

Value

A bomrang_tbl object (extension of a data.frame) of historical observations for the selected station/product type, with some subset of the following columns:

product_code: BOM internal code.
station_number: BOM station ID.
year: Year of observation (YYYY).
month: Month of observation (1-12).
day: Day of observation (1-31).
min_temperature: Minimum daily recorded temperature (degrees C).
max_temperature: Maximum daily recorded temperature (degrees C).
accum_days_min: Accumulated number of days of minimum temperature.
accum_days_max: Accumulated number of days of maximum temperature.
rainfall: Daily recorded rainfall in mm.
period: Period over which rainfall was measured.
solar_exposure: Daily global solar exposure in MJ/m^2.
quality: Y, N, or missing. Data which have not yet completed the
routine quality control process are marked accordingly.

The following attributes are set on the data, and these are used to generate the header:

site: BOM station ID.
name: BOM station name.
lat: Latitude in decimal degrees.
lon: Longitude in decimal degrees.
start: Date observations start.
end: Date observations end.
years: Available number of years data.
percent: Percent complete.
AWS: Automated weather station?
type: Measurement types available for the station.

Caution

Temperature data prior to 1910 should be used with extreme caution as many stations prior to that date were exposed in non-standard shelters. Some of which give readings which are several degrees warmer or cooler than those measured according to post-1910 standards.

Daily maximum temperatures usually occur in the afternoon and daily minimum temperatures overnight or near dawn. Occasionally, however, the lowest temperature in the 24 hours to prior to 9 AM can occur around 9 AM the previous day if the night was particularly warm.

Either stationid or latlon must be provided, but if both are, then stationid will be used as it is more reliable.

In some cases data is available back to the 1800s, so tens-of-thousands of daily records will be returned. Other stations will be newer and will return fewer observations.

dplyr Compatibility

The bomrang_tbl class is compatible with dplyr as long as the bomrang package is on the search path. Common functions (filter, select, arrange, mutate, rename, arrange, slice, group_by) are provided which mask the dplyr versions (but use those internally, maintaining attributes).

Note

Methods get_historical_weather and get_historical are equivalent. No preference is given to the use of either.

Author(s)

Jonathan Carroll, rpkg@jcarroll.com.au

See Also

get_current_weather

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
get_historical_weather(stationid = "023000",
                      type = "max") ## ~48,000+ daily records
get_historical_weather(latlon = c(-35.2809, 149.1300),
                       type = "min") ## 3,500+ daily records


get_historical(stationid = "023000",
              type = "max") ## ~48,000+ daily records
get_historical(latlon = c(-35.2809, 149.1300),
               type = "min") ## 3,500+ daily records

bomrang documentation built on March 29, 2021, 5:11 p.m.