pre_date <- function(x) {
y <- lubridate::year(x)
m <- lubridate::month(x)
result <- as.Date(
paste(
ifelse(m == 1, y - 1, y),
ifelse(m >= 2, m - 1, 12),
'01',
sep = '-'
)
)
return(result)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.