R/meandiff.R

#'@rdname internal
`meandiff` <-
function (x, FUN = median, na.rm = T) 
{
    d <- diff(x)
    ind <- d > 0
    c(FUN(d[d > 0], na.rm = na.rm), FUN(d[d < 0], na.rm = na.rm), 
        length(monotonic.segments(d)$values) - 1)
}

Try the IHA package in your browser

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

IHA documentation built on May 2, 2019, 5:15 p.m.