shift give.names could apply auto-name logic to list() input
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start by reproducing the shown data.table call to shift() with the list input and give.names = TRUE, then locate the shift() naming logic. Compare the result with the usual auto-naming for latitude and longitude, and add regression coverage showing the expected names.
Written by the indexing model from the issue text.
Description
set.seed(38493)
DT = data.table(latitude = runif(10, -90, 90), longitude = runif(10, -180, 180))
DT[ , shift(.(latitude, longitude), c(-1L, 1L), give.names = TRUE)]
V1_lead_1 V1_lag_1 V2_lead_1 V2_lag_1
1: -38.96353 NA -147.14499 NA
2: 29.04300 2.298902 -11.81201 44.61912
3: 85.19639 -38.963529 178.86941 -147.14499
4: -18.45281 29.042995 -159.37338 -11.81201
5: -24.63941 85.196393 -74.79962 178.86941
6: 39.93444 -18.452807 -63.89377 -159.37338
7: 89.09799 -24.639414 10.13899 -74.79962
8: -39.62935 39.934439 111.02200 -63.89377
9: 45.81521 89.097989 69.86217 10.13899
10: NA -39.629354 NA 111.02200
I kind of expected give.names to apply the "usual" (in data.table context at least) auto-names to the .(latitude, longitude) input.
- 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 ·