R/dc_validation_occurrencestatus_notstandard.R

Defines functions dc_validation_occurrencestatus_notstandard

Documented in dc_validation_occurrencestatus_notstandard

#' @rdname dc_validation_occurrencestatus_notstandard
#' 
#' @param TARGET a vector of occurrenceStatus information. To pass it must be
#' within given reference dictionary.
#' @param sources a vector of available sources.
#' 
dc_validation_occurrencestatus_notstandard <- function(
  TARGET = NULL,
  sources = c(
    "present",
    "absent"
  )
) {
  result <- TARGET %>%
    gsub(" ", "", .) %>% # Remove possible spaces
    gsub("_| |\\.|-", "", .) %>% # Remove seperators
    tolower()
  result <- result %in% sources
  return(perform_dc_missing(result, TARGET))
}
bd-R/bdchecks documentation built on Oct. 8, 2021, 5:10 p.m.