R/check_fid.R

Defines functions check_fid

Documented in check_fid

#' Check if a family ID is valid
#'
#' Check if a family ID is valid.
#' Will \link{stop} if not
#' @inheritParams default_params_doc
#' @return nothing
#' @author Richèl J.C. Bilderbeek
#' @examples
#' check_fid("1")
#' check_fid("Doe")
#' @export
check_fid <- function(fid) {
  if (length(fid) != 1) {
    stop(
      "'fid' must have one element \n",
      "length(fid): ", length(fid)
    )
  }
  testthat::expect_equal(class(fid), "character")
  testthat::expect_true(nchar(fid) >= 1)
  invisible(fid)
}
richelbilderbeek/plinkr documentation built on March 25, 2024, 3:18 p.m.