R/allDuplicated.R

Defines functions allDuplicated

Documented in allDuplicated

#' All Duplicated
#' Return logical vector marking any value that has a duplication of another value.
#'  Not just the duplicates of smaller indexes.
#'
#' @param vec Input vector that might have duplicate values
#'
#' @export
allDuplicated <- function(vec){
  front <- duplicated(vec)
  back <- duplicated(vec, fromLast = TRUE)
  all_dup <- front + back > 0
  return(all_dup)
}
genejockey33000/typGumbo documentation built on July 20, 2023, 11:45 p.m.