Skip to content
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

problem joining with character(0) #847

Closed
tvr101 opened this issue Oct 1, 2014 · 0 comments
Closed

problem joining with character(0) #847

tvr101 opened this issue Oct 1, 2014 · 0 comments
Assignees
Labels
Milestone

Comments

@tvr101
Copy link

tvr101 commented Oct 1, 2014

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 needed

if 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,c

is 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants