duplicated/anyDuplicated is not supported?
Open
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 81
- Forks
- 19
- Avg merge
- 20h 25m
- Merged PRs (30d)
- 3
Description
I guess this is a case of 64 bit int and NA handling?
library(s2)
cells <- s2_cells_at_level(5)
any(duplicated(cells)) # TRUE (wrong)
length(unique(cells)) # 6144 (right)
anyDuplicated(as.character(cells)) # 0 (right)
which(is.nan(unclass(cells)))
# [1] 4606 6142
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the supplied s2_cells_at_level(5) example, then trace how duplicated(), unique(), and anyDuplicated() handle s2 cell vectors and the NaN values shown by unclass(cells). Done means duplicated(cells) no longer reports a false duplicate while unique(cells) and anyDuplicated(as.character(cells)) retain their correct results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, r
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100