R/examples/ex-movmean.R

arr = rnorm(5*5*10) %>% array(dim = c(5, 5, 10))
r = movmean_R(arr, 1) %>% array_3dTo2d()

# only suit for 2d array
mat = array_3dTo2d(arr)
r2 = movmean2_mat(mat, 1, 1)

max(rowMeans2(abs(r - r2))) < 1e-5

Try the rtrend package in your browser

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

rtrend documentation built on June 22, 2024, 11:39 a.m.