Retrieves daily observations for a given station.
get_historical(
stationid = NULL,
latlon = NULL,
radius = NULL,
type = c("rain", "min", "max", "solar")
)
BOM station 'ID'. See Details.
Length-2 numeric vector of Latitude/Longitude. See Details.
Numeric value, distance (km) from latlon, must be numeric.
Measurement type, either daily "rain", "min" (temp), "max" (temp), or "solar" (exposure). Partial matching is performed. If not specified returns the first matching type in the order listed.
A bomrang_tbl
object (extension of a
data.frame
) of historical observations for the chosen
station/product type, with some subset of the following columns
Product_code: | BOM internal code. |
Station_number: | BOM station ID. |
Year: | Year of observation (YYYY). |
Month: | Month of observation (1-12). |
Day: | Day of observation (1-31). |
Min_temperature: | Minimum daily recorded temperature (degrees C). |
Max_temperature: | Maximum daily recorded temperature (degrees C). |
Accum_days_min: | Accumulated number of days of minimum temperature. |
Accum_days_max: | Accumulated number of days of maximum temperature. |
Rainfall: | Daily recorded rainfall in mm. |
Period: | Period over which rainfall was measured. |
Solar_exposure: | Daily global solar exposure in MJ/m^2. |
Quality: | Y, N, or missing. Data which have not yet completed the |
The following attributes are set on the data, and these are used to generate the header
site: | BOM station ID. |
name: | BOM station name. |
lat: | Latitude in decimal degrees. |
lon: | Longitude in decimal degrees. |
start: | Date observations start. |
end: | Date observations end. |
years: | Available number of years data. |
percent: | Percent complete. |
AWS: | Automated weather station? |
type: | Measurement types available for the station. |
Temperature data prior to 1910 should be used with extreme caution as many stations prior to that date were exposed in non-standard shelters. Some of which give readings which are several degrees warmer or cooler than those measured according to post-1910 standards.
Daily maximum temperatures usually occur in the afternoon and daily minimum temperatures overnight or near dawn. Occasionally, however, the lowest temperature in the 24 hours to prior to 9 AM can occur around 9 AM the previous day if the night was particularly warm.
Either stationid or latlon must be provided, but if both are, then stationid will be used as it is more reliable.
In some cases data is available back to the 1800s, so tens-of-thousands of daily records will be returned. Other stations will be newer and will return fewer observations.
The bomrang_tbl
class is
compatible with dplyr
as long as the
bomrang
package is on the search path. Common functions
(filter
, select
,
arrange
, mutate
,
rename
, arrange
,
slice
, group_by
) are provided
which mask the dplyr versions (but use those internally, maintaining
attributes).
# NOT RUN {
get_historical(stationid = "023000", type = "max") ## ~48,000+ daily records
get_historical(latlon = c(-35.2809, 149.1300),
type = "min") ## 3,500+ daily records
# }
Run the code above in your browser using DataCamp Workspace