#' Period between two dates with format
#' @param from <date>
#' @param to <date>
#' @return chr variable with format
periodFromDates <- function(from, to, format = '%2d years and %2d months'){
per <- lubridate::as.period(lubridate::interval(from, to), unit = "year")
sprintf(format, per@year, per@month)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.