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 the key of the target table.
- One option would be just to add this conversion to
"[.data.table" function code. I guess there are some reasons against as it have not been done yet, would be glad to hear it.
- When it happened first time, it took me some time to figure out what was the problem. It would be helpful to make error message more informative, just add
class(i) at the end of message in stop() call.
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 thekeyof 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.