I am trying to apply my moving average function to one variable as follow:
Fonction.mm <- function(x)
{
filter(x, poids, sides=1, method="conv")
}
numero<-1:nrow(data)
tapply(numero, data$td, Fonction.mm)
data$td
which is a character variable with 2 categories.
But this does not work getting the error:
Error in tapply(numero, data$td, Fonction.mm) :
arguments must have same length
Thanks a lot!