Check uniqueness of individual and specimen IDs

check_indiv_ids_dup(
  data,
  empty_values = c(NA, ""),
  success_msg = "Individual IDs are unique",
  fail_msg = "Duplicate individual IDs found"
)

check_specimen_ids_dup(
  data,
  empty_values = c(NA, ""),
  success_msg = "Specimen IDs are unique",
  fail_msg = "Duplicate specimen IDs found"
)

Arguments

data

Individual metadata file

empty_values

Values that are considered empty. Defaults to NA and "".

success_msg

Message indicating the check succeeded.

fail_msg

Message indicating the check failed.

Value

A condition object indicating whether the individual IDs in the individual metadata file are unique.

Examples

dat1 <- data.frame(individualID = c("x", "y", "z", "z")) check_indiv_ids_dup(dat1)
#> <error/check_fail> #> Duplicate individual IDs found
dat2 <- data.frame( individualID = c("x", "y", "z"), specimenID = c("a", "a", "b") ) check_specimen_ids_dup(dat2)
#> <error/check_fail> #> Duplicate specimen IDs found