parse_ag_bulletin: Parse local BOM agriculture bulletin XML file(s) for select...

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

View source: R/parse_ag_bulletin.R

Description

Parse local BOM agriculture bulletin XML file(s) and return a data frame for a specified state or territory or all Australia.

Usage

1

Arguments

state

Required value of an Australian state or territory as full name or postal code. Fuzzy string matching via agrep is done.

filepath

A string providing the directory location of the précis file(s) to parse. See Details for more.

Details

Allowed state and territory postal codes, only one state per request or all using AUS.

ACT

Australian Capital Territory (will return NSW)

NSW

New South Wales

NT

Northern Territory

QLD

Queensland

SA

South Australia

TAS

Tasmania

VIC

Victoria

WA

Western Australia

AUS

Australia, returns forecast for all states, NT and ACT

The filepath argument will only accept a directory where files are located for parsing. DO NOT supply the full path including the file name. This function will only parse the requested state or all of Australia in the same fashion as get_precis_forecast, provided that the files are all present in the directory.

Value

A data.table of Australia BOM agricultural bulletin information. For full details of fields and units returned see Appendix 3 in the bomrang vignette, use
vignette("bomrang", package = "bomrang") to view.

Author(s)

Adam H. Sparks, adamhsparks@gmail.com and Paul Melloy paul@melloy.com.au

References

Agricultural observations are retrieved from the Australian Bureau of Meteorology (BOM) Weather Data Services Agriculture Bulletins,
http://www.bom.gov.au/catalogue/observations/about-agricultural.shtml

and

Australian Bureau of Meteorology (BOM)) Weather Data Services Observation of Rainfall,
http://www.bom.gov.au/climate/how/observations/rain-measure.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_ag_bulletin

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# parse the ag bulletin for Queensland

# download to tempfile() using basename() to keep original name
download.file(url = "ftp://ftp.bom.gov.au/anon/gen/fwo/IDQ60604.xml",
              destfile = file.path(tempdir(),
              basename("ftp://ftp.bom.gov.au/anon/gen/fwo/IDQ60604.xml")),
              mode = "wb")

BOM_bulletin <- parse_ag_bulletin(state = "QLD",
                                  filepath = tempdir())

BOM_bulletin

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