R/allDups.R

Defines functions allDups

Documented in allDups

#' @title Identify all duplicates values in a vector.
#' @description By default the base R function duplicated only identifies the duplicated values after the first in a vector as TRUE. This function identifies all of the duplicates as true.
#' @param x The input vector.
#' @return A logical vector.
#' @export
allDups <- function(x){
  dups = duplicated(x) | duplicated(x, fromLast = TRUE)
  return(dups)
}

Try the bayesbio package in your browser

Any scripts or data that you put into this service are public.

bayesbio documentation built on May 2, 2019, 3:43 a.m.