get_current_weather: Get current weather observations of a BOM station

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/get_current_weather.R

Description

Get current weather observations of a BOM station

Usage

1
2
3
4
5
6
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).

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.

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.

Author(s)

Hugh Parsonage, hugh.parsonage@gmail.com

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

get_historical_weather

Examples

1
2
3
4
5
6
7
8
  # warning
  Melbourne_weather <- get_current_weather("Melbourne")

  # no warning
  Melbourne_weather <- get_current_weather("Melbourne (Olympic Park)")

  # Get weather by latitude and longitude:
  get_current_weather(latlon = c(-34, 151))

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