-
Notifications
You must be signed in to change notification settings - Fork 1k
fread with col.names and drop #7493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7493 +/- ##
==========================================
- Coverage 98.97% 98.96% -0.01%
==========================================
Files 87 87
Lines 16741 16757 +16
==========================================
+ Hits 16569 16584 +15
- Misses 172 173 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Generated via commit 4197bec Download link for the artifact containing the test results: ↓ atime-results.zip
|
inst/tests/tests.Rraw
Outdated
| # drop works with user override colnames #3459 | ||
| DT = data.table(a=c(1L, 4L), c=c(3L, 6L)) | ||
| test(2352.1, fread("a,b,c\n1,2,3\n4,5,6", drop='b'), DT) | ||
| test(2352.2, fread(col.names=c("a","b","c"),"1,2,3\n4,5,6", drop='b'), DT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens here?
fread(text = "
a,b,c
1,2,3
4,5,6
", col.names=c("b", "c", "d"), drop='b')There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Questionable! But current implementation favors header in read data > renaming col.names header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think either can be justified; I might find it more natural to prefer col.names.
either way we'll want to document it in ?fread and with a regression test.
cc @Rdatatable/committers to get consensus on the preferred approach.

Closes #3459