Learn R Programming

UKFE (version 0.3.7)

AddGauge: Add an AMAX sample

Description

This function allows the user to add an AMAX sample and associated catchment descriptors for use with the FEH process.

Usage

AddGauge(CDs, AMAX, ID)

Value

A list object. The first element is a data.frame which is a row of statistics and descriptors to be added to the NRFAData data.frame. The second element is the AMAX sample formatted to be added to the AMSP data.frame

Arguments

CDs

catchment descriptor object imported using the CDsXML function.

AMAX

Either a data.frame with date (or POSIXct) in the first column and a numeric vector in the second (the AMAX). Or an AMAX sample (a numeric vector).

ID

This is a user supplied identification number for the AMAX.

Author

Anthony Hammond

Details

The function provides the necessary AMAX sample statistics and data.frame for adding catchment descriptors to the NRFAData data.frame. The user must then add these outputs using the rbind function (see example). The AMAX could be read in or pasted in by the user or imported using the AMImport function. Once they are added they can be used in the current R session. If a new session is started (rather than a saved workspace) the added AMAX would need to be added again.

Examples

Run this code
#Read in AMAX and catchment descriptors
if (FALSE) AMAdd <- AMImport(r"{D:\NRFAPeakFlow_v12_1_0\suitable-for-neither\027003.am}")
if (FALSE) CDsAdd <- CDsXML(r"{D:\NRFAPeakFlow_v12_1_0\suitable-for-neither\027003.xml}")

#Apply the function and then add the results to the necessary data.frames.

if (FALSE) Gauge27003 <- AddGauge(CDsAdd, AMAdd, ID = "27003")
#Add the descriptors and stats (the first element of the output) to the NRFAData data.frame
if (FALSE) NRFAData <- rbind(NRFAData, Gauge27003[[1]])
#Add the AMAX to the AMSP data.frame.
if (FALSE) AMSP <- rbind(AMSP, Gauge27003[[2]])

Run the code above in your browser using DataLab