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

rbind/rbindlist don't combine integer64 columns correctly with other types #1349

Closed
eantonya opened this issue Sep 21, 2015 · 4 comments · Fixed by #3455
Closed

rbind/rbindlist don't combine integer64 columns correctly with other types #1349

eantonya opened this issue Sep 21, 2015 · 4 comments · Fixed by #3455
Milestone

Comments

@eantonya
Copy link
Contributor

dt1 = data.table(a = as.integer64(1), b = 1)
dt2 = data.table(a = 'a', b = 2)
dt3 = data.table(a = 1, b = 3)

# this works correctly
rbind(dt2, dt3)
#   a b
#1: a 2
#2: 1 3

# this doesn't work (and has an error message that's not true as per the above example)
rbind(dt1, dt2)
#Error in rbindlist(l, use.names, fill, idcol) : 
#  Class attributes at column 1 of input list at position 2 does not match with column 1 of input list at position 1. Coercion of objects of class 'factor' alone is handled internally by rbind/rbindlist at the moment.

# this doesn't work either
rbind(dt1, dt3)
@arunsrinivasan
Copy link
Member

The error message is meant for non-basic / derived (not sure how to call it) objects (i.e., date, posixct, etc.)

@kaybenleroll
Copy link

So does this mean it throws an error if rbind'ing on columns of dates etc? I use them all the time, so is it best to convert to character before binding, then convert back?

@jangorecki
Copy link
Member

@kaybenleroll it means it will raise error when rbind'ing integer64 to other class (character, numeric, ...). I prefer to get an error and convert explicitly so anyone who reads my code is aware of that type conversion.

@ucb
Copy link

ucb commented Dec 11, 2017

This issue is still present in the developer version I am using.

I am trying to rbindlist a list of data.tables. It turns out one of them had an integer64 column, while others, integer. The code did not produce an error or any alert, but the values in the column were largely messed up. There were tiny double values in place of integers.

@mattdowle mattdowle added this to the 1.12.2 milestone Mar 14, 2019
@mattdowle mattdowle mentioned this issue Mar 14, 2019
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants