Parse local BOM daily précis forecast XML file(s) and return a data frame of the seven-day town forecasts for a specified state or territory or all Australia.
Required value of an Australian state or territory as full name
or postal code. Fuzzy string matching via
A string providing the directory location of the précis file(s) to parse. See Details for more.
Allowed state and territory postal codes, only one state per request
or all using
Australian Capital Territory (will return NSW)
New South Wales
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.
data.table of Australia BOM précis
seven day forecasts for BOM selected towns. For full details of
fields and units returned see Appendix 2 in the bomrang vignette,
vignette("bomrang", package = "bomrang") to view.
Forecast data come from Australian Bureau of Meteorology (BOM)
Weather Data Services
Location data and other metadata for towns come from
the BOM anonymous FTP server with spatial data
ftp://ftp.bom.gov.au/anon/home/adfd/spatial/, specifically the DBF file portion of a shapefile,
1 2 3 4 5 6 7 8 9 10 11 12
# parse the short forecast for Queensland # download to tempfile() using basename() to keep original name download.file(url = "ftp://ftp.bom.gov.au/anon/gen/fwo/IDQ11295.xml", destfile = file.path(tempdir(), basename("ftp://ftp.bom.gov.au/anon/gen/fwo/IDQ11295.xml")), mode = "wb") BOM_forecast <- parse_precis_forecast(state = "QLD", filepath = tempdir()) BOM_forecast
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.