#' Inverted cumulative sum
#'
#' This is a decreasing version of \code{cumsum}.
#'
#' @param x numerical vector
#' @export
#' @examples
#' cumsum(1:10)
#' inv_cumsum(1:10)
inv_cumsum <- function(x) {
sum(x) - cumsum(x) + x
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.