-
Notifications
You must be signed in to change notification settings - Fork 978
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
which=NA inconsistent with ?data.table #4411
Milestone
Comments
I think we shouldn't be handling that specially. DT[A > 1, which=TRUE] is subsetting a data.table, whereas DT[ , .I[A > 1]] is subsetting an integer vector. And the error you got from |
jangorecki
added a commit
that referenced
this issue
May 6, 2020
mattdowle
pushed a commit
that referenced
this issue
Apr 19, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Was answering this question:
https://stackoverflow.com/q/61554066/3576984
and trying to mirror
base
behavior withwhich
, i.e., forwhich
to returnNA
elements ofi
asNA
:whereas
We can use e.g.
na.omit
to mirror thedata.table
behavior like.I[na.omit(A > 1)]
but doing the reverse seems awkward:I thought this in
?data.table
might be helpful:Sort of reads like
DT[A > 1, which = NA]
should return1L
, but it errors instead:Should we change the documentation, or is this a bug?
The text was updated successfully, but these errors were encountered: