#' International Fixed Calendar Date
#'
#' Return a character vector of dates converted from the Gregorian calendar
#' to the 13-month International Fixed Calendar.
#'
#' @param x A date vector.
#' @return A character vector of converted dates.
#' @examples
#' ifc_date(as.Date("2019-01-01"))
#' ifc_date(as.Date("2019-07-04"))
#' ifc_date(as.Date("2019-12-31"))
#' @importFrom lubridate year yday leap_year
#' @export
ifc_date <- function(x) {
y <- lubridate::year(x)
z <- lubridate::yday(x)
m <- sprintf("%02d", z %/% 28 + 1)
d <- sprintf("%02d", z %% 28)
paste(y, m, d, sep = "-")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.