any_duplicated_rows: Fast alternative to 'anyDuplicated()'

View source: R/RowGroups.R

any_duplicated_rowsR Documentation

Fast alternative to anyDuplicated()

Description

Implemented similarly to RowGroups().

Usage

any_duplicated_rows(x, cols = names(x))

Arguments

x

A data frame, tibble, or data.table.

cols

Columns to check for duplicates.

Details

With data.table input and the data.table package available, anyDuplicated.data.table() will be used.

Value

Index of the first duplicate row, if any; otherwise 0.

Examples

z <- SSBtoolsData("power10to2")
head(z, 12)
tail(z)

any_duplicated_rows(z, c("A", "B"))
any_duplicated_rows(z, c("a", "A", "B"))
any_duplicated_rows(z, c("a", "A", "b"))

SSBtools documentation built on Aug. 18, 2025, 9:07 a.m.