search for: nullnrow

Displaying 1 result from an estimated 1 matches for "nullnrow".

Did you mean: nullgrob
2024 Apr 05
1
duplicated() on zero-column data frames returns empty
...ject.org> ?????: > I found what looks to me like an odd edge case for duplicated(), > unique() etc. on data frames with zero columns, due to duplicated() > returning a zero-length vector for them, regardless of the number of > rows: > df <- data.frame(a = 1:5) > df$a <- NULLnrow(df) > # 5 (row count preserved by row.names) > duplicated(df) > # logical(0), should be c(FALSE, TRUE, TRUE, TRUE, TRUE) > anyDuplicated(df) > # 0, should be 2 > This behaviour isn't mentioned in the documentation; is there a > reason for it to work like this? <...>...