R/dc_validation_dateidentified_notstandard.R

Defines functions dc_validation_dateidentified_notstandard

Documented in dc_validation_dateidentified_notstandard

#' @rdname dc_validation_dateidentified_notstandard
#' 
#' @param TARGET a vector of dateIdentified information. To pass it must be a
#' valid ISO 8601-1:2019 date.
#' 
dc_validation_dateidentified_notstandard <- function(TARGET = NULL) {
  result <- TARGET %>%
    as.Date() %>% # Convert to date first so that following call woul return NA
    as.POSIXct() %>% # Gives NA for non-valid date
    is.na()
  return(perform_dc_missing(!result, TARGET))
}
bd-R/bdchecks documentation built on Oct. 8, 2021, 5:10 p.m.