#' Determine all duplicate elements
#'
#'
#' base::duplicated determines which elements of a vector or data frame are
#' duplicates of elements with smaller subscripts, and returns a logical vector
#' indicating which elements (rows) are duplicates.
#'
#' This wrapper allows to find all duplicated obs.
#'
#'
#' @param x Numeric vector of centimeter.
#' @param all.dup Logical: if TRUE considers duplicated each observation
#' present more than one time in the object, otherwise implement
#' base::duplicated algorithm (considers duplicated the second, third and so on
#' duplicated observation).
#' @param ... Other arguments passed to base::duplicated.
#' @return A logical vector with duplicated marked as TRUE.
#' @export
Duplicated <- function( x, all.dup = TRUE, ...) {
if (all.dup) {
base::duplicated(x, ...)| base::duplicated(x, fromLast = TRUE)
} else
base::duplicated(x, ...)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.