Detect excursion - core functionality

detectExcursionCore(
  time,
  vals,
  event.yr,
  event.window,
  ref.window,
  sig.num = 2,
  n.consecutive = 2,
  exc.type = "either",
  min.vals = 8,
  adjust.n.for.autocorrelation = FALSE,
  min.ref.window.coverage.fraction = 0.5,
  na.rm = TRUE
)

Arguments

time

time vector of only the points in the window

vals

value vector of only the points in the window

event.yr

time at the center of the excursion window

event.window

width (in time units) of the excursion window

ref.window

width (in time units) of the reference windows

sig.num

how many standard deviations required outside the reference windows must be exceeded for this to be considered an excursion? (default = 2)

n.consecutive

how many consecutive points are required for this to be considered an excursion? (default = 2)

exc.type

Type of excursion to look for. "positive", "negative", "either" or "both" (default = "either")

min.vals

Minimum effective sample size (adjusted by autocorrelation) required in reference and event windows (default = 4)

adjust.n.for.autocorrelation

Adjust the min.vals check to account for autocorrelation?

min.ref.window.coverage.fraction

reference windows must cover at least this fraction of the time.

na.rm

Remove NAs? (default = TRUE)

Value

a tibble of results