Title: | Retrieve Global River Gauge Data |
---|---|
Description: | Provides access to global river gauge data from a variety of national-level river agencies. The package interfaces with the national-level agency websites to provide access to river gauge locations, river discharge, and river stage. Currently, the package is available for the following countries: Australia, Brazil, Canada, Chile, France, Japan, South Africa, the United Kingdom, and the United States. |
Authors: | Ryan Riggs [aut, cre] , Simon Moulds [aut] , Michel Wortmann [aut] , Louise Slater [aut] , George Allen [aut] |
Maintainer: | Ryan Riggs <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.5 |
Built: | 2024-10-31 18:38:49 UTC |
Source: | https://github.com/ryan-riggs/rivretrieve |
Provides access to global river gauge data from a variety of national-level river agencies. The package interfaces with the national-level agency websites to provide access to river gauge locations, river discharge, and river stage. Currently, the package is available for the following countries: Australia, Brazil, Canada, Chile, France, Japan, South Africa, the United Kingdom, and the United States.
Maintainer: Ryan Riggs [email protected] (ORCID)
Authors:
Simon Moulds [email protected] (ORCID)
Michel Wortmann [email protected] (ORCID)
Louise Slater [email protected] (ORCID)
George Allen [email protected] (ORCID)
Useful links:
## Not run: print("TODO") ## End(Not run)
## Not run: print("TODO") ## End(Not run)
Retrieve Australian gauge data
australia( site, variable = "discharge", start_date = NULL, end_date = NULL, sites = FALSE, ... )
australia( site, variable = "discharge", start_date = NULL, end_date = NULL, sites = FALSE, ... )
site |
Australian gauge number |
variable |
Character. Either |
start_date |
Character. Optional start date with format YYYY-MM-DD. Default is 1900-01-01. |
end_date |
Character. End date with format YYYY-MM-DD. Default is the current date. |
sites |
Logical. If TRUE, returns a list of measurement sites. |
... |
Additional arguments. None implemented. |
data frame of discharge time-series
## Not run: sites <- australia(sites = TRUE) df <- australia(sites$site[1], "stage") plot(df$Date, df$H, type='l') ## End(Not run)
## Not run: sites <- australia(sites = TRUE) df <- australia(sites$site[1], "stage") plot(df$Date, df$H, type='l') ## End(Not run)
Retrieve Brazilian gauge data
brazil( site, variable = "discharge", start_date = NULL, end_date = NULL, sites = FALSE, ... )
brazil( site, variable = "discharge", start_date = NULL, end_date = NULL, sites = FALSE, ... )
site |
Brazilian gauge number |
variable |
Character. Either |
start_date |
Character. Optional start date with format YYYY-MM-DD. Default is 1900-01-01. |
end_date |
Character. End date with format YYYY-MM-DD. Default is the current date. |
sites |
Logical. If TRUE, returns a list of measurement sites. |
... |
Additional arguments. None implemented. |
data frame of discharge time-series
## Not run: df <- brazil('12650000') plot(df$Date, df$Q, type='l') ## End(Not run)
## Not run: df <- brazil('12650000') plot(df$Date, df$Q, type='l') ## End(Not run)
Retrieve Canadian gauge data
canada( site, variable = "discharge", start_date = NULL, end_date = NULL, sites = FALSE, ... )
canada( site, variable = "discharge", start_date = NULL, end_date = NULL, sites = FALSE, ... )
site |
Canadian gauge number |
variable |
Character. Either |
start_date |
Character. Optional start date with format YYYY-MM-DD. Default is 1900-01-01. |
end_date |
Character. End date with format YYYY-MM-DD. Default is the current date. |
sites |
Logical. If TRUE, returns a list of measurement sites. |
... |
Additional arguments. None implemented. |
data frame of discharge time-series
## Not run: #For the first time, you must run: tidyhydat::download_hydat() df = canada("01AD003") plot(df$Date, df$Q, type='l') ## End(Not run)
## Not run: #For the first time, you must run: tidyhydat::download_hydat() df = canada("01AD003") plot(df$Date, df$Q, type='l') ## End(Not run)
Retrieve Chilean gauge data
chile( site, variable = "discharge", start_date = NULL, end_date = NULL, sites = FALSE, ... )
chile( site, variable = "discharge", start_date = NULL, end_date = NULL, sites = FALSE, ... )
site |
Chilean gauge number |
variable |
Character. Either |
start_date |
Character. Optional start date with format YYYY-MM-DD. Default is 1900-01-01. |
end_date |
Character. End date with format YYYY-MM-DD. Default is the current date. |
sites |
Logical. If TRUE, returns a list of measurement sites. |
... |
Additional arguments. None implemented. |
data frame of discharge time-series
## Not run: df <- chile('01201005') plot(df$Date, df$Q, type='l') ## End(Not run)
## Not run: df <- chile('01201005') plot(df$Date, df$Q, type='l') ## End(Not run)
Retrieve French gauge data
france( site, variable = "discharge", start_date = NULL, end_date = NULL, sites = FALSE, ... )
france( site, variable = "discharge", start_date = NULL, end_date = NULL, sites = FALSE, ... )
site |
French gauge number |
variable |
Character. Either |
start_date |
Character. Optional start date with format YYYY-MM-DD. Default is 1900-01-01. |
end_date |
Character. End date with format YYYY-MM-DD. Default is the current date. |
sites |
Logical. If TRUE, returns a list of measurement sites. |
... |
Additional arguments. None implemented. |
data frame of discharge time-series
## Not run: df <- france('K027401001') plot(df$Date, df$Q, type='l') ## End(Not run)
## Not run: df <- france('K027401001') plot(df$Date, df$Q, type='l') ## End(Not run)
get_timeseries_id
retrieves the timeseries ID that can be used to obtain
values for a parameter type, station and timeseries combination.
get_timeseries_id(parameter_type, station_number, ts_name)
get_timeseries_id(parameter_type, station_number, ts_name)
parameter_type |
The parameter of interest (e.g. Water Course Discharge). |
station_number |
The AWRC station number. |
ts_name |
The BoM time series name (e.g. DMQaQc.Merged.DailyMean.24HR). |
Returns a tibble with columns station_name, station_no, station_id, ts_id, ts_name, parametertype_id, parametertype_name.
Retrieve Japanese gauge data
japan( site, variable = "discharge", start_date = NULL, end_date = NULL, sites = FALSE, ... )
japan( site, variable = "discharge", start_date = NULL, end_date = NULL, sites = FALSE, ... )
site |
Japanese gauge number |
variable |
Character. Either |
start_date |
Character. Optional start date with format YYYY-MM-DD. Default is 1900-01-01. |
end_date |
Character. End date with format YYYY-MM-DD. Default is the current date. |
sites |
Logical. If TRUE, returns a list of measurement sites. |
... |
Additional arguments. None implemented. |
data frame of discharge time-series
## Not run: start_date <- as.Date("2019-01-01") end_date <- as.Date("2022-12-31") df <- japan("301011281104010", "discharge", start_date, end_date) plot(df$Date, df$Q, type='l') ## End(Not run)
## Not run: start_date <- as.Date("2019-01-01") end_date <- as.Date("2022-12-31") df <- japan("301011281104010", "discharge", start_date, end_date) plot(df$Date, df$Q, type='l') ## End(Not run)
This function queries the Bureau of Meteorology Water Data KISTERS API. A parameter list is passed to make request and the JSON return is parsed depending on what is requested. This function can be used if you want to build your own JSON queries.
make_bom_request(params)
make_bom_request(params)
params |
A named list of parameters. |
A tibble is returned with the columns depending on the request. For
get_timeseries
requests, a tibble with zero rows is returned
if there is no data available for that query.
Get original data
original(x, ...)
original(x, ...)
x |
Tibble. |
... |
Additional arguments. None implemented. |
list
Plot values
## S3 method for class 'rr_tbl' plot(x, ...)
## S3 method for class 'rr_tbl' plot(x, ...)
x |
Tibble. |
... |
Additional arguments. None implemented. |
ggplot2
Retrieve South African gauge data
southAfrica( site, variable = "stage", start_date = NULL, end_date = NULL, sites = FALSE, ... )
southAfrica( site, variable = "stage", start_date = NULL, end_date = NULL, sites = FALSE, ... )
site |
South African gauge number |
variable |
Character. Either |
start_date |
Character. Optional start date with format YYYY-MM-DD. Default is 1900-01-01. |
end_date |
Character. End date with format YYYY-MM-DD. Default is the current date. |
sites |
Logical. If TRUE, returns a list of measurement sites. |
... |
Additional arguments. None implemented. |
data frame of discharge time-series
## Not run: site <- "X3H023" start_date <- as.Date("2000-01-01") end_date <- as.Date("2010-01-01") x <- southAfrica(site, "stage", start_date, end_date) ## End(Not run)
## Not run: site <- "X3H023" start_date <- as.Date("2000-01-01") end_date <- as.Date("2010-01-01") x <- southAfrica(site, "stage", start_date, end_date) ## End(Not run)
Retrieve UK gauge data
uk(site, variable, start_date = NULL, end_date = NULL, sites = FALSE, ...)
uk(site, variable, start_date = NULL, end_date = NULL, sites = FALSE, ...)
site |
UK gauge number |
variable |
Character. Either |
start_date |
Character. Optional start date with format YYYY-MM-DD. Default is 1900-01-01. |
end_date |
Character. End date with format YYYY-MM-DD. Default is the current date. |
sites |
Logical. If TRUE, returns a list of measurement sites. |
... |
Additional arguments. None implemented. |
data frame of discharge time-series
site <- "http://environment.data.gov.uk/hydrology/id/stations/3c5cba29-2321-4289-a1fd-c355e135f4cb" x <- uk(site, variable = "discharge") plot(x$Date, x$Q, type='l')
site <- "http://environment.data.gov.uk/hydrology/id/stations/3c5cba29-2321-4289-a1fd-c355e135f4cb" x <- uk(site, variable = "discharge") plot(x$Date, x$Q, type='l')
Retrieve USA gauge data
usa( site, variable = "stage", start_date = NULL, end_date = NULL, sites = FALSE, ... )
usa( site, variable = "stage", start_date = NULL, end_date = NULL, sites = FALSE, ... )
site |
USA gauge number |
variable |
Character. Either |
start_date |
Character. Optional start date with format YYYY-MM-DD. Default is 1900-01-01. |
end_date |
Character. End date with format YYYY-MM-DD. Default is the current date. |
sites |
Logical. If TRUE, returns a list of measurement sites. |
... |
Additional arguments. None implemented. |
data frame of discharge time-series
## Not run: df <- usa("02471078", variable="discharge") plot(df$Date, df$Q, type='l') ## End(Not run)
## Not run: df <- usa("02471078", variable="discharge") plot(df$Date, df$Q, type='l') ## End(Not run)