Returns a vector with the cumulative sum of the maximum length of dry spell (MLDS)

cumdrought(x)

Arguments

x

a numeric vector

Value

a vector with the cumulative sum of MLDS

Examples


rain <- c(0,0.2,0.4,0.1,0.4,5.1,1.5,1.6,0.1,0,7,6,4,6,0.1,1.2,0.5,0)

cumdrought(rain)
#>  [1] 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5