#' Moving Mean
#'
#' Moving Mean
#' @export
moving_mean <- function(x,k){
if(length(x) == 1)
x
else
caTools:::runmean(x, k=k, align="right", endrule="mean",alg="C")
}
#' Moving sd
#'
#' Moving sd
moving_sd <- function(x,k){
if(length(x) == 1)
x
else
caTools:::runsd(x, k=k, align="right", endrule="sd")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.