Check if there is any duplicate rows indexed by given columns. If YES, it will give warning.

CheckDuplicateRow(.data, .vars)

Arguments

.data

A data.frame.

.vars

Names of Columns to group by. If missing, use the first column name.

Value

TRUE if there exists duplicate rows, otherwise FALSE.

Examples

df <- data.frame(Id = c(1, 1), name = c("A", "B")) flightscanner:::CheckDuplicateRow(df)
#> Warning: df has duplicate Id.
#> [1] TRUE
flightscanner:::CheckDuplicateRow(df, "name")
#> [1] FALSE