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
Closed

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

cguill95 opened this issue Apr 10, 2017 · 2 comments
Assignees
Labels
bug
Milestone

Comments

@cguill95
Copy link

@cguill95 cguill95 commented Apr 10, 2017

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 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

@arunsrinivasan arunsrinivasan commented Jun 29, 2017

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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

5 participants
You can’t perform that action at this time.