Defunct: This function is defunct as of version 2.0.0 because the underlying BOM agricultural forecast bulletin service is no longer available.
parse_ag_bulletin(state, filepath)
Arguments
state: Required value of an Australian state or territory as full name or postal code. Fuzzy string matching via base::agrep() is done.
filepath: A string providing the directory location of the précis file(s) to parse. See Details for more.
Returns
A data.table::data.table() of Australia BOM agricultural bulletin information.
Details
Parse local BOM agriculture bulletin XML file(s) for a specified state or territory or all Australia. Ported from bomrang.
Allowed state and territory postal codes, only one state per request or all using AUS.
AUS: Australia, returns forecast for all states, NT and ACT
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
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.
Examples
# parse the ag bulletin for Western Australia# download to tempfile() using basename() to keep original nameutils::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")parse_ag_bulletin(state ="QLD", filepath = tempdir())
References
Agricultural observations are retrieved from the Australian Bureau of Meteorology (BOM ) Weather Data Services Agriculture Bulletins,