mean_run | R Documentation |
Running mean in specified window of numeric vector.
mean_run(
x,
k = integer(0),
lag = integer(1),
idx = integer(0),
at = integer(0),
na_rm = TRUE,
na_pad = FALSE
)
x |
|
k |
( |
lag |
( |
idx |
( |
at |
( |
na_rm |
|
na_pad |
( |
mean (numeric
) vector of length equals length of x
.
set.seed(11)
x1 <- rnorm(15)
x2 <- sample(c(rep(NA, 5), rnorm(15)), 15, replace = TRUE)
k <- sample(1:15, 15, replace = TRUE)
mean_run(x1)
mean_run(x2, na_rm = TRUE)
mean_run(x2, na_rm = FALSE)
mean_run(x2, na_rm = TRUE, k = 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.