Learn R Programming

UKFE (version 0.3.7)

GetFlowStage_EA: Get flow or level data from the Environment Agency's Hydrology Data Explorer

Description

Function to extract flow or level data from the Environment Agency's Hydrology Data Explorer.

Usage

GetFlowStage_EA(
  Lat = 54,
  Lon = -2.25,
  Range = 10,
  RiverName = NULL,
  WISKI_ID = NULL,
  From = "2015-10-01",
  To = "2016-09-30",
  Type = "flow",
  Period = "DailyMean"
)

Value

If searching for gauge details with lat and lon or river name, then a list is returned. The first element is a dataframe with flow gauge details and the second is a dataframe of level gauge details. When extracting flow or level data with a WISKI ID then a dataframe with two columns is returned. The first being a Date or POSIXct column/vector and the second is the timeseries of interest.

Arguments

Lat

Latitude (as a decimal) for the centre of the search for gauges

Lon

Longitude (as a decimal) for the centre of the search for gauges

Range

Radius of search when using latitude and longitude inputs (km).

RiverName

Name of the river along which you want to search for gauges. Character string.

WISKI_ID

The WISKI ID for the gauge from which you want to obtain data (character string)

From

Date for start of data extraction in the format of "2015-12-02"

To

Date for the end of data extraction in the format of "2015-12-02"

Type

The variable to extract, either "flow" or "level"

Period

The sampling rate of the data you want. Either "DailyMax", "DailyMean", "Houlry", "15Mins".

Author

Anthony Hammond

Details

To find gauges you can input either a river name or a latitude and longitude. The latter will provide all flow and level gauges within a specified range (default of 10km). This provides gauged details including the WISKI ID. You can get data from specific gauges using the WISKI_ID. Note that many level gauges also have level data available.

Examples

Run this code
#Find gauges on the river Tame
if (FALSE) GetFlowStage_EA(RiverName = "Tame")
#Find gauges within 10km of a latlon grid reference somewhere near the centre of Dartmoor
if (FALSE) GetFlowStage_EA(lat = 50.6, lon = -3.9, Range = 10)
#Get daily maximum flow data from the Bellever gauge on the
#East Dart River for the default From - To date range
if (FALSE) BelleverMax <- GetFlowStage_EA(WISKI_ID = "SX67F051")

Run the code above in your browser using DataLab