R/I_rollMean.R

Defines functions .rollMean

# Very simple and stupid rolling mean
.rollMean <- function(vett, Lag)
{
  nObs <- length(vett)
  output <- numeric(nObs)
  
  for(ii in 1:nObs)
    output[ii] <- mean(vett[max(1, ii - Lag + 1):ii])
  
  return( output )
}

Try the synlik package in your browser

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

synlik documentation built on March 7, 2023, 8:39 p.m.