R/edge.R

Defines functions edge

edge <- function(x, k = 3, threshold = 50) {
  x.dif <- rollMax(x,
    k = k,
    align = "center"
  ) - rollMax(x,
    k = k,
    align = "right"
  )
  x0 <- which(x.dif > threshold)
  breaks <- unique(c(which(dif(x0) > 1) - 1, length(x0)))
  x0[breaks]
}

Try the xRing package in your browser

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

xRing documentation built on April 22, 2022, 5:05 p.m.