R/date.R

Defines functions as.Date.integer

Documented in as.Date.integer

#' Convert YYYYMM to Date
#' 
#' @param x \code{integer} vector.
#' @param day \code{character} specifying the day of the month.
#' @param ... additional arguments passed to \link[base]{as.Date}.
#' 
#' @returns 
#' vector of \code{Date}s
#' 
#' @export
#' 
as.Date.integer <- function(x, day = "01", ...){
  as.Date(paste0(x, day), format = "%Y%m%d", ...)  
}
  
eguidotti/eap documentation built on Sept. 4, 2024, 3:43 a.m.