R/extract.turnpoints.R

extract.turnpoints <- function(e, n, no.tp = 0, peak = 1, pit = -1, ...) {
  if (missing(n)) n <- -1
  res <- rep(no.tp, length.out = e$n)
  res[e$pos[e$peaks]] <- peak
  res[e$pos[e$pits]] <- pit
  # Keep only the first n points
  if (n < length(res) & n > 0) res <- res[1:n]
  res
}

Try the pastecs package in your browser

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

pastecs documentation built on May 2, 2019, 3:36 p.m.