getAnnual function

Get annual rainfall of different rainfall time series

Get annual rainfall of different rainfall time series

Get annual rainfall of different raninfall time series.

getAnnual(data, output = "series", minRecords = 355, ...) ## S4 method for signature 'data.frame' getAnnual(data, output = "series", minRecords = 355, ...) ## S4 method for signature 'list' getAnnual(data, output = "series", minRecords = 355, ...)

Arguments

  • data: A list containing different time series of different rainfall gauges. Or a dataframe with first column Date and the rest columns the value of different gauging stations. Usually an output of list2Dataframe.
  • output: A string showing the output output.
  • minRecords: A number showing the minimum accept record number, e.g. for a normal year(365 days), if minRecords = 360, it means if a year has less than 360 records of a year, it will be ignored in the mean annual value calculation. Only valid when output = "mean", default is 355.
  • ...: title, x, y showing the title and x and y axis of the plot. e.g. title = 'aaa'

Returns

The annual rainfall and the number of missing data of each year and each rainfall gauge, which will also be plotted. If output "mean" is seleted, the mean annual rainfall will be returned.

Details

It is a generic function, if in your case you need to debug, please see ?debug()

for how to debug S4 method.

Examples

#datalist is provided by the package as a test. data(testdl) a <- getAnnual(testdl) #set minRecords to control the calculation of annual rainfall. b <- getAnnual(testdl, output = 'mean', minRecords = 350) c <- getAnnual(testdl, output = 'mean', minRecords = 365) a1 <- extractPeriod(testdl, comm = TRUE) a2 <- list2Dataframe(a1) getAnnual(a2) a3 <- fillGap(a2) getAnnual(a3) # More examples can be found in the user manual on https://yuanchao-xu.github.io/hyfo/

References

  • H. Wickham. ggplot2: elegant graphics for data analysis. Springer New York, 2009.
  • Hadley Wickham (2007). Reshaping Data with the reshape Package. Journal of Statistical Software, 21(12), 1-20. URL http://www.jstatsoft.org/v21/i12/.
  • R Core Team (2015). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL https://www.R-project.org/.

Other functions in hyfo

Related functions from the same R package

  • Maintainer: Yuanchao Xu
  • License: GPL-2
  • Last published: 2023-08-16