R/ts_gs.R

Defines functions ts_gs

Documented in ts_gs

#' Determine the number of growing seasons in a temporal series.
#'
#'
#'
#' @param x a vector that represent a temporal serie
#' @param max.ft the maximum coeffient that will be used to trace the number of growing seassons
#'
#' @return
#' @export
#'
#' @examples
ts_gs <- function(x, max.ft=5){
  y <- as.integer(which.max(abs(fft(x))[2:max.ft]))

  return(y)
}
dpabon/ecofunr documentation built on July 15, 2020, 12:58 p.m.