Manipuler des séries temporelles en R
Harrison Brown
Graduate Researcher in Geography
zoo::roll* :
rollmean()rollmax()rollsum()Limites :
rollmin() !rollapply(data = ftse,
width = 7,
FUN = min,
align = 'right',
fill = NA)
Arguments :
data : Objet de série temporellewidth : Largeur de la fenêtre (k)FUN : Fonction de synthèse (mean, max, ...)align : Alignement de la fenêtre ('left', 'right' ou 'center')fill : Valeurs à renseigner hors fenêtreObjectif :
daily_temp
2019-01-01 13.191304
2019-01-02 6.945833
2019-01-03 8.495833
2019-01-04 8.683333
2019-01-05 7.400000
...
find_range <- function(x){
max(x) - min(x)
}
daily_temp_range <-
rollapply(
daily_temp,
FUN = find_range,
width = 30,
align = 'right',
fill = NA
)
autoplot(daily_temp_range) +
theme_light() +
labs(y = 'Plage de températures')

Manipuler des séries temporelles en R