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

Wrong behaviour DT[, i, with=FALSE] #2109

Closed
cguill95 opened this issue Apr 10, 2017 · 2 comments · Fixed by #3775
Closed

Wrong behaviour DT[, i, with=FALSE] #2109

cguill95 opened this issue Apr 10, 2017 · 2 comments · Fixed by #3775
Assignees
Labels
Milestone

Comments

@cguill95
Copy link

Hi,

I noticed a strange type of behaviour using the with=FALSE parameter in a data table.
Maybe worth mentioning I am using data table version 1.10.4. on R 3.3.2

Here is a reproducible example;

library(data.table)
test <- data.table(mtcars)
i <- 3L

# Print 3rd column
test[, i, with=FALSE]

# Print 4th column
test[, i + 1L, with=FALSE]

# Print all but 3rd column
test[, i - 1L, with=FALSE]
@franknarf1
Copy link
Contributor

franknarf1 commented Apr 10, 2017

Yeah, I guess it parses the expression, sees that - is the top-level function and wings it from there somehow, similar to this bug: #2069 Parentheses stop it: test[, (i - 1L), with=FALSE]

@arunsrinivasan
Copy link
Member

IIUC this line would need a length(jsub) == 2L extra condition...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants