powered by
A function for computing rolling any of time-series data.
roll_any(x, width, min_obs = width, complete_obs = FALSE, na_restore = FALSE, online = TRUE)
logical matrix or xts object. Rows are observations and columns are variables.
integer. Window size.
integer. Minimum number of observations required to have a value within a window, otherwise result is NA.
NA
logical. If TRUE then rows containing any missing values are removed, if FALSE then each value is used.
TRUE
FALSE
logical. Should missing values be restored?
logical. Process observations using an online algorithm.
An object of the same class and dimension as x with the rolling any.
x
# NOT RUN { n_vars <- 3 n_obs <- 15 x <- matrix(rnorm(n_obs * n_vars), nrow = n_obs, ncol = n_vars) # rolling any result <- roll_any(x < 0, 5) # }
Run the code above in your browser using DataLab