-
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
handling i which is a factor #1632
Comments
Related to #1621 -- seems we'd do well to give better errors when |
well, for me, it's not the same situation there - it is not processing of |
Are you converting to integer or character (factor levels)? |
I am converting it to the same class as the |
Agree, we need to add check for is.factor, current error is little bit confusing. setkey(data.table(a=factor("a")))[factor("a")]
#Error in `[.data.table`(setkey(data.table(a = factor("a"))), factor("a")) :
# i has evaluated to type integer. Expecting logical, integer or double. |
This was unfortunate. The workaround was in fact to just wrap factor |
It happens quite often to me that column which I passed as
i
, turns out to be a factor. Current behavior is to throw an error: "i has not evaluated to logical, integer or double", so I have to manually convert it to the same class as thekey
of the target table."[.data.table"
function code. I guess there are some reasons against as it have not been done yet, would be glad to hear it.class(i)
at the end of message instop()
call.The text was updated successfully, but these errors were encountered: