R/wiggle.env.R

Defines functions `wiggle.env`

`wiggle.env` <-
function(x,  y )
{
  ###  givn an x,y signal, get the smoothed peaks
  why = y-mean(y)	
  aa = peaks(why, span=3, do.pad = TRUE)
  w = aa & why>0

  smsp = smooth.spline( cbind(x[w], why[w])  , spar = 0.2)

  return( smsp )
}

Try the RSEIS package in your browser

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

RSEIS documentation built on Aug. 19, 2023, 5:07 p.m.