Retrieves daily observations for a given station.

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.

Note

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

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).

See also

Author

Jonathan Carroll, [email protected]

Examples

# \donttest{ get_historical_weather(stationid = "023000", type = "max") ## ~48,000+ daily records
#> Data saved as /tmp/Rtmp6ERo0A/IDCJAC0010_023000_1800_Data.csv
#> --- Australian Bureau of Meteorology (BOM) Data Resource --- #> (Original Request Parameters) #> Station: ADELAIDE (WEST TERRACE / NGAYIRDAPIRA) [023000] #> Location: lat: -34.9257, lon: 138.5832 #> Measurement / Origin: Max / Historical #> Timespan: 1887-01-01 -- 2020-11-01 [95.7 years] #> --------------------------------------------------------------- #> product_code station_number year month day max_temperature #> 1: IDCJAC0010 23000 1887 1 1 NA #> 2: IDCJAC0010 23000 1887 1 2 NA #> 3: IDCJAC0010 23000 1887 1 3 NA #> 4: IDCJAC0010 23000 1887 1 4 NA #> 5: IDCJAC0010 23000 1887 1 5 NA #> --- #> 48899: IDCJAC0010 23000 2020 11 17 25.8 #> 48900: IDCJAC0010 23000 2020 11 18 33.4 #> 48901: IDCJAC0010 23000 2020 11 19 35.4 #> 48902: IDCJAC0010 23000 2020 11 20 29.7 #> 48903: IDCJAC0010 23000 2020 11 21 38.9 #> accum_days_max quality #> 1: NA #> 2: NA #> 3: NA #> 4: NA #> 5: NA #> --- #> 48899: 1 N #> 48900: 1 N #> 48901: 1 N #> 48902: 1 N #> 48903: 1 N
get_historical_weather(latlon = c(-35.2809, 149.1300), type = "min") ## 3,500+ daily records
#> #> Closest station: 070351 (CANBERRA AIRPORT)
#> Data saved as /tmp/Rtmp6ERo0A/IDCJAC0011_070351_1800_Data.csv
#> --- Australian Bureau of Meteorology (BOM) Data Resource --- #> (Original Request Parameters) #> Station: CANBERRA AIRPORT [070351] #> Location: lat: -35.3088, lon: 149.2004 #> Measurement / Origin: Min / Historical #> Timespan: 2008-09-01 -- 2020-11-01 [12.3 years] #> --------------------------------------------------------------- #> product_code station_number year month day min_temperature accum_days_min #> 1: IDCJAC0011 70351 2008 1 1 NA NA #> 2: IDCJAC0011 70351 2008 1 2 NA NA #> 3: IDCJAC0011 70351 2008 1 3 NA NA #> 4: IDCJAC0011 70351 2008 1 4 NA NA #> 5: IDCJAC0011 70351 2008 1 5 NA NA #> --- #> 4706: IDCJAC0011 70351 2020 11 18 10.8 1 #> 4707: IDCJAC0011 70351 2020 11 19 9.2 1 #> 4708: IDCJAC0011 70351 2020 11 20 11.4 1 #> 4709: IDCJAC0011 70351 2020 11 21 11.0 1 #> 4710: IDCJAC0011 70351 2020 11 22 14.3 1 #> quality #> 1: #> 2: #> 3: #> 4: #> 5: #> --- #> 4706: N #> 4707: N #> 4708: N #> 4709: N #> 4710: N
# } # \donttest{ get_historical(stationid = "023000", type = "max") ## ~48,000+ daily records
#> Data saved as /tmp/Rtmp6ERo0A/IDCJAC0010_023000_1800_Data.csv
#> --- Australian Bureau of Meteorology (BOM) Data Resource --- #> (Original Request Parameters) #> Station: ADELAIDE (WEST TERRACE / NGAYIRDAPIRA) [023000] #> Location: lat: -34.9257, lon: 138.5832 #> Measurement / Origin: Max / Historical #> Timespan: 1887-01-01 -- 2020-11-01 [95.7 years] #> --------------------------------------------------------------- #> product_code station_number year month day max_temperature #> 1: IDCJAC0010 23000 1887 1 1 NA #> 2: IDCJAC0010 23000 1887 1 2 NA #> 3: IDCJAC0010 23000 1887 1 3 NA #> 4: IDCJAC0010 23000 1887 1 4 NA #> 5: IDCJAC0010 23000 1887 1 5 NA #> --- #> 48899: IDCJAC0010 23000 2020 11 17 25.8 #> 48900: IDCJAC0010 23000 2020 11 18 33.4 #> 48901: IDCJAC0010 23000 2020 11 19 35.4 #> 48902: IDCJAC0010 23000 2020 11 20 29.7 #> 48903: IDCJAC0010 23000 2020 11 21 38.9 #> accum_days_max quality #> 1: NA #> 2: NA #> 3: NA #> 4: NA #> 5: NA #> --- #> 48899: 1 N #> 48900: 1 N #> 48901: 1 N #> 48902: 1 N #> 48903: 1 N
get_historical(latlon = c(-35.2809, 149.1300), type = "min") ## 3,500+ daily records
#> #> Closest station: 070351 (CANBERRA AIRPORT)
#> Data saved as /tmp/Rtmp6ERo0A/IDCJAC0011_070351_1800_Data.csv
#> --- Australian Bureau of Meteorology (BOM) Data Resource --- #> (Original Request Parameters) #> Station: CANBERRA AIRPORT [070351] #> Location: lat: -35.3088, lon: 149.2004 #> Measurement / Origin: Min / Historical #> Timespan: 2008-09-01 -- 2020-11-01 [12.3 years] #> --------------------------------------------------------------- #> product_code station_number year month day min_temperature accum_days_min #> 1: IDCJAC0011 70351 2008 1 1 NA NA #> 2: IDCJAC0011 70351 2008 1 2 NA NA #> 3: IDCJAC0011 70351 2008 1 3 NA NA #> 4: IDCJAC0011 70351 2008 1 4 NA NA #> 5: IDCJAC0011 70351 2008 1 5 NA NA #> --- #> 4706: IDCJAC0011 70351 2020 11 18 10.8 1 #> 4707: IDCJAC0011 70351 2020 11 19 9.2 1 #> 4708: IDCJAC0011 70351 2020 11 20 11.4 1 #> 4709: IDCJAC0011 70351 2020 11 21 11.0 1 #> 4710: IDCJAC0011 70351 2020 11 22 14.3 1 #> quality #> 1: #> 2: #> 3: #> 4: #> 5: #> --- #> 4706: N #> 4707: N #> 4708: N #> 4709: N #> 4710: N
# }