#' Accumulate earnings
#' @param data tibble with calculated earnings (see `calculate earnings`)
accumulate_earnings <- function(data) {
data %>%
dplyr::arrange(BetDay) %>%
dplyr::summarise(Time = unique(BetDay),
Bets = cumsum(Bets),
Stake = cumsum(Stake),
Revenue = cumsum(Revenue),
Earnings = cumsum(Earnings),
Return = round(100 * (Earnings / Stake), 2))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.