#' calculate the average spend per HH
#' @export
#' @param spend numeric variable
avg_spend <- function(input) {
avg_input_spend <- aggregate(input$spend, by=list(input$cust), FUN=mean)
colnames(avg_input_spend)[1] <- "cust"
colnames(avg_input_spend)[2] <- "spend"
return(avg_input_spend)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.