Learn R Programming

openmeteo (version 0.2.4)

river_discharge: Retrieve river discharge data from the Open-Meteo API

Description

river_discharge() calls the Open-Meteo Global Flood API to obtain simulated river discharge from the nearest river. Data obtained from the Global Flood Awareness System (GloFAS). Forecasts and historical data is available.

Refer to the API documentation at: https://open-meteo.com/en/docs/flood-api

Usage

river_discharge(location, start = NULL, end = NULL, daily = NULL, model = NULL)

Value

Requested river discharge data (m³/s) for the given location and time period, as a tidy tibble.

Arguments

location

Required. The location for which data will be retrieved. Supplied as either a c(latitude,longitude) WGS84 coordinate pair or a place name string (with co-ordinates obtained via geocode()).

start, end

Start and end dates in ISO 8601 (e.g. "2020-12-31"). If no dates are supplied, data for the next 3 months will be provided by default.

daily

Required. A weather variable accepted by the API, or list thereof. See details below.

model

Supply to specify a model for forecasted values (defaults to latest GloFAS model).

Details

You will need to specify at least one river discharge variable to retrieve data for. These variables are sampled or aggregated at daily intervals, and can be supplied as a list to request multiple variables over the same time period.

Example daily forecast variables include:

VariableDescription
river_dischargeDaily river discharge rate in m³/s
river_discharge_medianMedian over ensemble members (forecasts only)
river_discharge_maxMaximum over ensemble members (forecasts only)

Full documentation for the forecast API is available at: https://open-meteo.com/en/docs/flood-api

Examples

Run this code
# \donttest{
# obtain historical flood data for Brisbane
river_discharge("Brisbane",
  "2022-01-01", "2022-02-01",
  daily = "river_discharge"
)
# }

Run the code above in your browser using DataLab