data(ray)
ray <- as.xts(ray)["1970::1979", ]
r <- find_droughts(ray)
head(r)
summary(r)
# \donttest{
plot(r)
# }
# threshold is to low, because there are many days with
# zero flow observations
# provide threshold as a constant value
r <- find_droughts(ray, threshold = 0.02)
head(r)
summary(r)
# \donttest{
plot(r)
# }
# provide threshold as a function
r <- find_droughts(ray,
threshold = function(x) quantile(x, 0.2, na.rm = TRUE))
head(r)
summary(r)
Run the code above in your browser using DataLab