Skip to content
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

Negative select in fread #2423

Closed
MichaelChirico opened this issue Oct 17, 2017 · 1 comment
Closed

Negative select in fread #2423

MichaelChirico opened this issue Oct 17, 2017 · 1 comment
Labels
Milestone

Comments

@MichaelChirico
Copy link
Member

MichaelChirico commented Oct 17, 2017

fread('v1,v2,v3,v4,v5\n1,2,3,4,5', select = -1L)

Error in fread("v1,v2,v3,v4,v5\n1,2,3,4,5", select = -1L) :
Column number -1 (select[1]) is out of range [1,ncol=5]

Seems natural enough to allow negative selection as elsewhere in R & [.data.table

Expected output

data.table(V2 = 2, V3 = 3, V4 = 4, V5 = 5)
#    V2 V3 V4 V5
# 1:  2  3  4  5
@MichaelChirico
Copy link
Member Author

Hmm, of course there's drop. Perhaps a nudge message ("Are you sure you didn't mean drop = ..." when select is all negative), or automatically flipping select to drop (and vice versa) when all indices are negative...

@mattdowle mattdowle added this to the v1.10.6 milestone Oct 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants