R/hasInvalidIdChar.R

Defines functions hasInvalidIdChar

## Copyright(c) 2017-2026 R. Mark Sharp
## This file is part of nprcgenekeepr

#' Detect IDs containing a disallowed character
#'
#' Animal IDs (\code{id}, \code{sire}, \code{dam}) must be alphanumeric with no
#' symbols. In particular a period (".") is disallowed. This is the single
#' definition of that rule, reused by \code{qcStudbook} (data input) and
#' \code{geneDrop} (point of use).
#'
#' @param ids character vector of IDs to test.
#' @return logical vector, \code{TRUE} where the corresponding ID contains a
#' disallowed character (currently the period). \code{NA} elements return
#' \code{FALSE}.
#' @noRd
hasInvalidIdChar <- function(ids) {
  !is.na(ids) & grepl(".", ids, fixed = TRUE)
}

Try the nprcgenekeepr package in your browser

Any scripts or data that you put into this service are public.

nprcgenekeepr documentation built on July 26, 2026, 5:06 p.m.