#' six_months_only
#'
#' An easy function for getting only the most recent six months from a data frame
#' @param df A data frame
#' @export
six_months_only <- function(df) {
m <- df %>%
distinct(month) %>%
arrange(desc(month)) %>%
slice(1:6)
m <- m[['month']]
df <- df %>%
filter(month %in% m)
return(df)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.