| AddGauge | R Documentation |
This function allows the user to add an AMAX sample and associated catchment descriptors for use with the FEH process.
AddGauge(CDs, AMAX, ID)
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. |
The function provides the necessary AMAX sample statistics and data.frame for adding catchment descriptors to the PeakFlowData 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.
A list object. The first element is a data.frame which is a row of statistics and descriptors to be added to the PeakFlowData data.frame. The second element is the AMAX sample formatted to be added to the AMPF data.frame
Anthony Hammond
# Read in AMAX and catchment descriptors
## Not run:
am_add <- AMImport(r"{D:\NRFAPeakFlow_v12_1_0\suitable-for-neither\027003.am}")
cds_add <- CDsXML(r"{D:\NRFAPeakFlow_v12_1_0\suitable-for-neither\027003.xml}")
## End(Not run)
# Apply the function and add the results to the necessary data frames
## Not run:
gauge_27003 <- AddGauge(cds_add, am_add, ID = "27003")
## End(Not run)
# Append the descriptors and stats (element[[1]]) to PeakFlowData
## Not run:
nrfa_data <- rbind(PeakFlowData, gauge_27003[[1]])
## End(Not run)
# Append the AMAX series (element[[2]]) to AMPF
## Not run:
ampf <- rbind(AMPF, gauge_27003[[2]])
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.