check_indiv_ids_dup: Check uniqueness of individual and specimen IDs

Description Usage Arguments Value Examples

View source: R/check-ids-duplicate.R

Description

Check uniqueness of individual and specimen IDs

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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

1
2
3
4
5
6
7
8
dat1 <- data.frame(individualID = c("x", "y", "z", "z"))
check_indiv_ids_dup(dat1)

dat2 <- data.frame(
  individualID = c("x", "y", "z"),
  specimenID = c("a", "a", "b")
)
check_specimen_ids_dup(dat2)

dccvalidator documentation built on July 2, 2020, 4:05 a.m.