Re: [R] duplicated() on zero-column data frames returns empty vector

2024-04-05 Thread Mark Webster via R-help
Hello Ivan, thanks for this. > Part of the problem is that it's not obvious what should be a > zero-column but non-zero-row data.frame mean. >  > On the one hand, your database relation use case is entirely valid. On > the other hand, if data.frames are considered to be tables of data with >

Re: [R] duplicated() on zero-column data frames returns empty vector

2024-04-05 Thread Ivan Krylov via R-help
Hello Mark, В Fri, 5 Apr 2024 03:58:36 + (UTC) Mark Webster via R-help пишет: > 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 >

[R] duplicated() on zero-column data frames returns empty vector

2024-04-05 Thread Mark Webster via R-help
Hello, 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