GetDataNRFA: Get National River Flow Archive data using gauge ID.

View source: R/GetData.R

GetDataNRFAR Documentation

Get National River Flow Archive data using gauge ID.

Description

Extracts NRFA data using the API.

Usage

GetDataNRFA(ID, Type = "Q")

Arguments

ID

ID number of the gauge of interest.

Type

Type of data required. One of "Q", "P", "PQ", "Gaugings", "AMAX", "POT", or "Catalogue".

Details

The function can be used to get daily catchment rainfall or mean flow, or both together (concurrent). It can also be used to get gaugings, AMAX, and POT data. Note that some sites have rejected peak flow years. In which case, if Type = AMAX or POT, the function returns a list, the first element of which is the rejected years, the second is the full AMAX or POT. Lastly if Type = "Catalogue" it will return a dataframe of all the NRFA gauges, associated details, comments, and descriptors.

Value

A data.frame with date in the first columns and variable/s of interest in the remaining column/s. Except for the following circumstances: When Type = "Catalogue", then a large dataframe is returned with all the NRFA gauge metadata. When Type = "AMAX" or "POT" and there are rejected years a list is returned. Where the first element is the dataframe of data and the second is rejected year/s (character string).

Author(s)

Anthony Hammond

Examples

#Get the concurrent rainfall and mean flow series for the Tay at Ballathie (site 15006).
## Not run: BallathiePQ <-  GetDataNRFA(15006, "PQ")
#Now we'll get the gaugings
## Not run: BallathieGaugings <- GetDataNRFA(15006, "Gaugings") 

UKFE documentation built on April 4, 2025, 12:55 a.m.

Related to GetDataNRFA in UKFE...