get_cd: A function to obtain information on the station and on the...

View source: R/get_winfapapi.R

get_cdR Documentation

A function to obtain information on the station and on the catchment upstream of the station using the NRFA API


The function queries the NRFA API for for information of a given station. Unlike get_amax and get_pot, the output of this function is not exactly the same from the output of the read_cd3 function due to differences in the information made available by the NRFA API


get_cd(station, fields = "feh")



the NRFA station(s) number for which the the information is required


the type of information which is required. Can be "feh" (default), which outputs a subset of information typically used when applying the flood estimation handbook methods, or "all", which output all information made available in the NRFA API.


a data.frame of one row with different columns depending on whether fields = "all" or fields = "feh" was selected.

See Also

read_cd3. Information on catchment descriptors river flow gauging in the UK can be found at the National River Flow Archive website


 cdMult <- get_cd(c(40003,42003), fields = "all")
 ### lots of information on the catchment/station
 ### including information on rejected annual maxima
 cdMult$`40003`$`peak-flow-rejected-amax-years` ## no rejections
 cdMult$`42003`$`peak-flow-rejected-amax-years` ## several rejections
 cd40003 <- get_cd(40003, fields = "feh")
 # less information, mostly the FEH descriptors
 sapply(cdMult, ncol)

winfapReader documentation built on Sept. 8, 2022, 5:08 p.m.