Nothing
#' cum_lag
#'
#' @description helpful function to cumulate information.
#'
#' @param x numeric vector for which lag variable should be computed
#' @param n_lag size of lag window
#'
#' @return return numeric vector.
cum_lag <- function(x, n_lag){
result <- 0
for(i in 1:n_lag){
result <- result + ifelse(is.na(lag(x, i)), 0, lag(x, i))
}
return(result)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.