Learn R Programming

SSBtools (version 1.8.1)

any_duplicated_rows: Fast alternative to anyDuplicated()

Description

Implemented similarly to RowGroups().

Usage

any_duplicated_rows(x, cols = names(x))

Value

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

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.

Examples

Run this code
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"))

Run the code above in your browser using DataLab