-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
I recently upgraded to 1.9.2 and encountered the following issue. Previously this returned an empty data.table as I had expected (and desired), but now returns an error:
x <- data.table(a=character(0), b=character(0), c=numeric(0))
setkey(x, a, b)
x[J("foo", character(0)), nomatch=0]
Error in if (mn%%n[i] != 0) warning("Item ", i, " is of size ", n[i], :
missing value where TRUE/FALSE needed
x[J(character(0), "foo"),nomatch=0]
Error in if (mn%%n[i] != 0) warning("Item ", i, " is of size ", n[i], :
missing value where TRUE/FALSE neededif there is only one key then this seems to behave as before
x <- data.table(a=character(0), b=character(0), c=numeric(0))
setkey(x, a)
x[J(character(0)),nomatch=0]
Empty data.table (0 rows) of 3 cols: a,b,cis this expected with the new release? in my actual usage character(0) is a value held by another variable and that variable is used to search inside the data.table - is it user's responsibility to now check and avoid searching with empty character vectors?
Reactions are currently unavailable