The function computes the rolling maximum value along a time series.
Details
It calculates the maximum over consecutive elements centered within a specified window.
For each index i, it considers a window of length points centered around i.
When length is odd, the center falls exactly on i and the window extends
equally to both sides.
When length is even, the window extends one less point to the left than to
the right and the rolling max is not exactly centered.
Values near the start of the series use windows with fewer than length
data points if there are not enough preceding elements to form a full window.
Similarly for values at the end.
Examples
# Compute rolling max over a 24-hour period on hourly time series data
data(stMeteo)
ws_24h <- rollingMax(mydata = stMeteo$ws, length = 24)
