bomrang (version 0.6.0)

get_current_weather: Get Current Weather Observations of a BOM Station

Description

Get Current Weather Observations of a BOM Station

Usage

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 the vignette "Current Weather Fields": vignette("Current Weather Fields", 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

Examples

Run this code
# NOT RUN {
  # 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))
# }

Run the code above in your browser using DataCamp Workspace