get_current_weather: Get Current Weather Observations of a BOM Station

Description Usage Arguments Details Value Author(s) References Examples

View source: R/get_current_weather.R

Description

Get Current Weather Observations of a BOM Station

Usage

1
2
get_current_weather(station_name, strict = FALSE, latlon = NULL,
  raw = FALSE, emit_latlon_msg = TRUE, as.data.table = FALSE)

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.

raw

Logical. Do not convert the columns data.table to the appropriate classes. (FALSE by default.)

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

as.data.table

Logical. If TRUE, return result as a data.table.

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.

Value

Tidy 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, [email protected]

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

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

ToowoombaTrio/BOMRang documentation built on Dec. 3, 2018, 3:14 p.m.