duplicated2: Determine all duplicate elements

View source: R/data_management.R

duplicated2R Documentation

Determine all duplicate elements

Description

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.

Usage

duplicated2(x, all = TRUE, ...)

Arguments

x

Numeric vector of centimeter.

all

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).

...

Other arguments passed to base::duplicated.

Details

This wrapper allows to find all duplicated obs.

Value

A logical vector with duplicated marked as TRUE.

Examples

duplicated( c(1,0, 2, 0, 3, 2)) # from base R
duplicated2(c(1,0, 2, 0, 3, 2)) # from lbmisc

lbraglia/lbmisc documentation built on June 14, 2025, 6:44 p.m.