check_dups: Check for duplicates in a vector

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Check for duplicates in a vector

Usage

1
check_dups(x, name = "")

Arguments

x

the vector

name

the name of the object to print in an error message if duplicates are found

Value

silently returns NULL

Examples

1
2
3
4
5
# this will throw an erorr, let's catch it
tryCatch(
  check_dups(c("a", "b", "c", "a", "d")),
  error=function(e) print(e)
  )

cmapR documentation built on Dec. 12, 2020, 2 a.m.