#' @title
#' End of Month
#'
#' @description
#' Return the last day of the month for each date in a vector of dates
#'
#' @details
#' Returns the last day of the month for each date in a vector of dates
#'
#' @param dates A vector of dates
#'
#' @export
#'
#' @examples
#' eom(as.Date("2016-2-14"))
#' eom(seq.Date(as.Date("2015-1-1"), as.Date("2015-12-31"), by="month"))
eom <- function(dates, p = as.POSIXlt(dates)){
# Returns the last day of the month for each Date in dates
p$mon <- p$mon + 1
p$mday <- 0
return(as.Date(p))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.