You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
accessing rows via a factor column throws error #1361
the thrown error is: Error in bmerge(i, x, leftcols, rightcols, io <- FALSE, xo, roll = 0, : x.'f' is a factor column being joined to i.'V1' which is type 'double'. Factor columns must join to factor or character columns.
the error can be avoided by adding additional conditions, e.g. dt[f==3 & TRUE] or by comparing to characters (as indicated by the error itself): dt[f=="3"]. not sure, whether this is a bug or a feature, but I though it's worthwhile reporting.
The problem seems to be that on line 471 of data.table.R, you check
mode(x[[isub2]]) != mode(RHS)
However, both factors and integers have mode "numeric", so it skips this part and moves on to the standard auto-indexing, where bmerge chokes. I'm not sure what the right substitution is for line 471 but that is where the fix should go.
Activity
caneff commentedon Sep 28, 2015
Running into this too. This seems to be very similar to isssue #957 but with factors instead of characters.
caneff commentedon Sep 28, 2015
The problem seems to be that on line 471 of data.table.R, you check
mode(x[[isub2]]) != mode(RHS)However, both factors and integers have mode "numeric", so it skips this part and moves on to the standard auto-indexing, where bmerge chokes. I'm not sure what the right substitution is for line 471 but that is where the fix should go.
caneff commentedon Oct 1, 2015
Ping? This is breaking our existing code so we are stuck with 1.9.4 until this gets fixed.