avg_adj | R Documentation |
Calculate average of vector elements adjacent to and excluding the index element. For example, the second element of the result is the average of the first and third elements of the input vector x
. Used by smooth_age_5_zigzag_inner()
, and possibly useful elsewhere.
avg_adj(x)
x |
numeric vector |
Tails are given a value of NA
.
numeric vector the same length as x
.
x <- 1:10
all(avg_adj(x) == x, na.rm = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.