Get current weather observations of a BOM station

get_current_weather(
  station_name,
  strict = FALSE,
  latlon = NULL,
  emit_latlon_msg = TRUE
)

Arguments

station_name

The name of the weather station. Fuzzy string matching via agrep is done.

strict

(logical) If TRUE, station_name must match the station name exactly, except that station_name need not be upper case. Note this may be different to full_name in the response. See Details.

latlon

A length-2 numeric vector giving the decimal degree latitude and longitude (in that order), e.g., latlon = c(-34, 151) for Sydney. When given instead of station_name, the nearest station (in this package) is used, with a message indicating the nearest such station. (See also sweep_for_stations.) Ignored if used in combination with station_name, with a warning.

emit_latlon_msg

Logical. If TRUE (the default), and latlon is selected, a message is emitted before the table is returned indicating which station was actually used (i.e., which station was found to be nearest to the given coordinate).

Value

A bomrang_tbl object (extension of a data.frame) of requested BOM station's current and prior 72hr data. For full details of fields and units returned, see Appendix 1 in the bomrang vignette, use
vignette("bomrang", package = "bomrang") to view.

Details

Station names are not consistently named within the Bureau, so the response may contain a different full_name to the one matched, even if strict = TRUE. For example,
get_current_weather("CASTLEMAINE PRISON")[["full_name"]][1]
is Castlemaine, not Castlemaine Prison.

Note that the column local_date_time_full is set to a POSIXct object in the local time of the user. For more details see “Appendix 1 - Output from get_current_weather()” in the bomrang vignette
vignette("bomrang", package = "bomrang")
for a complete list of fields and units.

References

Weather data observations are retrieved from: Australian Bureau of Meteorology (BOM) Weather Data Services, Observations - individual stations: http://www.bom.gov.au/catalogue/data-feeds.shtml

Station location and other metadata are sourced from the Australian Bureau of Meteorology (BOM) webpage, Bureau of Meteorology Site Numbers: http://www.bom.gov.au/climate/cdo/about/site-num.shtml

See also

Author

Hugh Parsonage, [email protected]

Examples

# \donttest{ # warning Melbourne_weather <- get_current_weather("Melbourne")
#> Warning: Multiple stations match station_name. Using #> station_name = 'MELBOURNE AIRPORT' #> Did you mean any of the following? #> station_name = 'MELBOURNE (OLYMPIC PARK)'
# no warning Melbourne_weather <- get_current_weather("Melbourne (Olympic Park)") # Get weather by latitude and longitude: get_current_weather(latlon = c(-34, 151))
#> Using station_name = 'HOLSWORTHY AERODROME AWS', at latitude = -33.9925, longitude = 150.9489 (4.78 km away).
#> --- Australian Bureau of Meteorology (BOM) Data Resource --- #> (Original Request Parameters) #> Station: HOLSWORTHY AERODROME AWS [066161] #> Location: lat: -33.9925, lon: 150.9489 #> Measurement / Origin: All / Current #> Timespan: 2012 -- 2020 [8 years] #> --------------------------------------------------------------- #> sort_order wmo full_name history_product local_date_time #> 1: 0 95761 Holsworthy IDN60801 22/04:30pm #> 2: 1 95761 Holsworthy IDN60801 22/04:00pm #> 3: 2 95761 Holsworthy IDN60801 22/03:30pm #> 4: 3 95761 Holsworthy IDN60801 22/03:00pm #> 5: 4 95761 Holsworthy IDN60801 22/02:30pm #> --- #> 137: 136 95761 Holsworthy IDN60801 19/07:00pm #> 138: 137 95761 Holsworthy IDN60801 19/06:30pm #> 139: 138 95761 Holsworthy IDN60801 19/06:00pm #> 140: 139 95761 Holsworthy IDN60801 19/05:30pm #> 141: 140 95761 Holsworthy IDN60801 19/05:00pm #> local_date_time_full aifstime_utc lat lon apparent_t #> 1: 2020-11-22 16:30:00 2020-11-22 05:30:00 -33.9925 150.9489 30.0 #> 2: 2020-11-22 16:00:00 2020-11-22 05:00:00 -33.9925 150.9489 29.9 #> 3: 2020-11-22 15:30:00 2020-11-22 04:30:00 -33.9925 150.9489 30.7 #> 4: 2020-11-22 15:00:00 2020-11-22 04:00:00 -33.9925 150.9489 29.4 #> 5: 2020-11-22 14:30:00 2020-11-22 03:30:00 -33.9925 150.9489 28.3 #> --- #> 137: 2020-11-19 19:00:00 2020-11-19 08:00:00 -33.9925 150.9489 18.8 #> 138: 2020-11-19 18:30:00 2020-11-19 07:30:00 -33.9925 150.9489 20.3 #> 139: 2020-11-19 18:00:00 2020-11-19 07:00:00 -33.9925 150.9489 21.2 #> 140: 2020-11-19 17:30:00 2020-11-19 06:30:00 -33.9925 150.9489 20.4 #> 141: 2020-11-19 17:00:00 2020-11-19 06:00:00 -33.9925 150.9489 21.8 #> cloud cloud_base_m cloud_oktas cloud_type cloud_type_id delta_t #> 1: Mostly clear NA 1 - NA 6.9 #> 2: - NA NA - NA 6.7 #> 3: Partly cloudy 3600 3 - NA 6.7 #> 4: Mostly clear 2500 1 - NA 6.3 #> 5: Partly cloudy 1500 3 - NA 5.8 #> --- #> 137: - NA NA - NA 4.3 #> 138: - NA NA - NA 4.7 #> 139: - NA NA - NA 5.1 #> 140: - NA NA - NA 5.2 #> 141: - NA NA - NA 5.5 #> gust_kmh gust_kt air_temp dewpt press press_msl press_qnh press_tend #> 1: 11 6 28.9 18.1 1012.3 1012.3 1012.5 - #> 2: 13 7 28.7 18.2 1012.4 1012.4 1012.6 - #> 3: 9 5 28.6 18.1 1012.9 1012.9 1013.1 - #> 4: 7 4 27.8 17.9 1013.6 1013.6 1013.8 - #> 5: 13 7 26.5 17.3 1014.0 1014.0 1014.2 - #> --- #> 137: 35 19 21.9 14.5 1018.5 1018.5 1018.7 - #> 138: 33 18 22.6 14.7 1018.0 1018.0 1018.2 - #> 139: 32 17 23.4 14.9 1017.7 1017.7 1017.9 - #> 140: 32 17 23.4 14.7 1017.8 1017.8 1018.0 - #> 141: 35 19 24.3 15.2 1017.7 1017.7 1017.9 - #> rain_trace rel_hum sea_state swell_dir_worded swell_height swell_period #> 1: 0 NA - - NA NA #> 2: 0 NA - - NA NA #> 3: 0 NA - - NA NA #> 4: 0 NA - - NA NA #> 5: 0 NA - - NA NA #> --- #> 137: NA NA - - NA NA #> 138: NA NA - - NA NA #> 139: NA NA - - NA NA #> 140: NA NA - - NA NA #> 141: NA NA - - NA NA #> vis_km weather wind_dir wind_spd_kmh wind_spd_kt #> 1: 10 - N 9 5 #> 2: 10 - NNE 9 5 #> 3: 10 - NNE 4 2 #> 4: 10 Rain NE 6 3 #> 5: 10 - WNW 4 2 #> --- #> 137: 10 - ENE 24 13 #> 138: 10 - ENE 20 11 #> 139: 10 - ENE 20 11 #> 140: 10 - ENE 24 13 #> 141: 10 - ENE 22 12
# }