prevYear <- function(dateObject, prevMonth){
ifelse(prevMonth=="12"
,as.character(lubridate::year(dateObject) - 1)
,as.character(lubridate::year(dateObject))
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.