R/ann.cv.R

Defines functions ann.cv

Documented in ann.cv

ann.cv <- function(flow.ts) {
    flow.ts$year <- strftime(flow.ts$Date, format = "%Y")
    ann.stats <- aggregate(flow.ts["Q"], flow.ts["year"], mean, na.rm = T)
    
    
    out <- sd(ann.stats$Q, na.rm = T)/mean(ann.stats$Q, na.rm = T) * 100
    
    return(data.frame(ann.cv = out))
} 

Try the hydrostats package in your browser

Any scripts or data that you put into this service are public.

hydrostats documentation built on June 1, 2022, 9:06 a.m.