#'@rdname internal
pulses <- function(x, q){
  runs <- findInterval(x, q, rightmost.closed = T)
  runs.length        <- rle(runs)
  runs.length$values <- as.factor(c("low", "med", "high")[runs.length$values + 1])

#'Calculate change rate for a vector
#'Calculate change rate for a vector
#'@param x a vector
change.rate <- function(x){
  dx <- diff(x)
  dx / x[-length(x)]

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.