Displaying 1 result from an estimated 1 matches for "database_rel".
Did you mean:
database_redo
2024 Apr 05
1
duplicated() on zero-column data frames returns empty
...row.names are
required to be unique. I'm sure that more interpretations can be
devised, requiring some other behaviour for duplicated() and friends.
Thankfully, duplicated() and anyDuplicated() are generic functions, and
you can subclass your data frames to change their behaviour:
duplicated.database_relation <- function(x, incomparables = FALSE, ...)
if (length(x)) return(NextMethod()) else c(
FALSE, rep(TRUE, nrow(x) - 1)
)
.S3method('duplicated', 'database_relation')
anyDuplicated.database_relation <- function(
x, incomparables = FALSE, ...
) if (nrow(x) > 1) 2 els...