means_along <- function(a, i) {
n <- length(dim(a))
b <- aperm(a, c(seq_len(n)[-i], i))
rowMeans(b, dims = n - 1, na.rm = T)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.