Why are duplicated column names in data.table with by=.EACHI not fixed?
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 30/100
Research direction
Start by running the supplied R and data.table example to reproduce the duplicated column names. Trace the non-equi join using on and by = .EACHI, and check the project documentation for how result columns are constructed. Done means determining whether this is expected behavior and documenting the meaning of both time columns or identifying the correction needed.
Written by the indexing model from the issue text.
Description
A while ago I created a stackoverflow question:
https://stackoverflow.com/questions/78994519/why-are-duplicated-column-names-in-data-table-with-by-eachi-not-fixed
The question there is: Why does the result of the following operation
library(data.table)
dt <- data.table(time = c(13, 20, 26))
dt[,time10 := time - 10]
dt[dt, on = .(time >= time10, time <= time), .N,by = .EACHI]
contain twice a column named "time"?
time time N
<num> <num> <int>
1: 3 13 1
2: 10 20 2
3: 16 26 2
I personally feel like this should not happen. I also do not understand, where the first column named "time" comes from.
I use R 4.5.0 and data.table 1.17.2
In case this is a bug, I could elaborate more, otherwise feel free to close this issue.
Is there any documentation for what these two "time" columns mean and how they are constructed?
- Dominant language
- R
- Stars
- 3.9k
- Forks
- 1.1k
- Avg merge
- 14h 4m
- Merged PRs (30d)
- 4
Contributor guide
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.
More from Rdatatable/data.table
-
as.data.table() recurses without end on a survival::Surv object (or any data.frame carrying one) Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Rdatatable/data.table#7887 ·
-
consistency tests
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Rdatatable/data.table#7853 · 3 comments ·
-
internals
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Rdatatable/data.table#6938 · 1 comment ·
-
encoding fread
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Rdatatable/data.table#5179 · 8 comments ·
-
documentation programming
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Rdatatable/data.table#3199 · 3 comments ·
All issues in Rdatatable/data.table
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
r-lib/pkgdepends#485 · 3 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
beginners blocker
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enviPathR OpenBuild Error Build OK Build Warning policies-accepted pre-review precheck-passed
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Bioconductor/BiocContributions#207 · 6 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
datacarpentry/semester-biology#1255 ·