R/getAllDups.R

Defines functions getAllDups

Documented in getAllDups

#' Shapes the ddPCR data into a better format for ggplot
#' 
#' @param x the vector you're looking for duplicates in
#' 
#' @export
#' 
#' @return Returns indices of all duplicates
#' 
#' @examples
#' dup_indices <- getAllDups(x)

getAllDups <- function(x) {
  top <- which(duplicated(x))
  bot <- which(duplicated(x, fromLast = T))
  both <- union(top, bot)
  dup.indices <- both[order(both)]
  return(dup.indices)
}
syyang93/yangR documentation built on March 1, 2021, 4:55 p.m.