#' Format dates
#' @export
#' @examples
#' \dontrun{dateformat(x)}
# Logical - is it in proper format or not?
dateformat = function(x) {
if (!is.na(as.numeric(substring(x,1,4))) &
substring(x,5,5) == "-" &
!is.na(as.numeric(substring(x,6,7))) &
substring(x,8,8) == "-" &
!is.na(as.numeric(substring(x,9,10))) &
is.Date(as.Date(x)))
return(TRUE)
else {
return(FALSE)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.