Learn R Programming

bomWater (version 0.4.1)

get_timeseries: Get time series

Description

Get timeseries data from Water Data online

Usage

get_timeseries(
  parameter_type,
  station_number,
  start_date,
  end_date,
  tz,
  return_fields,
  ts_name
)

Arguments

parameter_type

The water data parameter type (e.g. Water Course Discharge). See parameters() for a full list.

station_number

The AWRC station number.

start_date

Start date formatted as a string or date class (YYYY-MM-DD).

end_date

End date formatted as a string or date class (YYYY-MM-DD).

tz

Optional: the desired time zone for the output timeseries. Input must be an Olson Name (see OlsonNames()). By default the the timeseries is returned in an offset timezone (e.g. Etc/GMT-10 for NSW) as the timeseries do not observe DST.

return_fields

Optional: columns to be returned from Water Data Online. By default Timestamp, Value and Quality Code are returned.

ts_name

The timeseries name (e.g. DMQaQc.Merged.DailyMean.24HR) that is desired.

Value

A tibble with columns with the requested return_fields. A zero row tibble is returned if no data is returned from the query. The columns of the tibble are returned as character classes and have not been formatted to more appropriate correct classes (this happens in other functions).

Details

This function can be used if you want to retrieve a specific timeseries that is not the default quality checked one.

Common valid return fields are:

  • Timestamp

  • Value

  • Quality Code

  • Interpolation Type

Other valid return fields (depending on the parameter requested) may be:

  • Absolute Value

  • AV Interpolation

  • AV Quality Code

  • Runoff Value

  • RV Interpolation

  • RV Quality Code

  • Aggregation

  • Accuracy

If the request is not valid it will fail.

See Also

Examples

Run this code
# NOT RUN {
# Accessible dam storage, as shown on the BoM Water Storage dashboard
# }
# NOT RUN {
get_timeseries(
  parameter_type = "Storage Volume",
  "G8150011",
  "2020-01-01",
  "2020-01-31",
  ts_name = "PR02AVQaQc.Merged.DailyMean.24HR",
  tz = NULL,
  return_fields = c("Timestamp", "Value", "Quality Code")
)
# }
# NOT RUN {
# See the linked SOS2 manual in See Also to find more timeseries names
# }

Run the code above in your browser using DataLab