tests/nspot/nspot_test.R

## create the x dataset
library(floodRFA)
xx <- canadaFlood$daily

source(paste(getwd(),'R/nspot.R' , sep='/'))

ulst <- ThreshCandidate(xx, flow~date, u = .7, r = 14)

fit <- xx %>%
  ExtractNsFloodPeaks(flow~date, u = ulst[1], r = 14, link = 'log') %>%
  FitNsPot(flow~date, startp = c(2000,0))

plot(fit)

ref <- data.frame( date = seq(as.Date('2000-01-01'),as.Date('2010-01-01'), '1 years'))

u <- GetThresh(fit, ref)
m <- GetIndx(fit, ref)

u

m
martindurocher/floodRFA documentation built on June 5, 2019, 8:44 p.m.