I am was working with a dataframe, which I had to convert into a data table for manipulation. When I try to rbind()
the 2 data tables, I get the following warning message
require(data.table)
table1 <- data.table(x)
table2 <- data.table(y)
## I did a lot of processing here for these 2 tables, then wanted to bind them
bt=rbind(table1,table2)
Warning message:
In rbindlist(allargs) : NAs introduced by coercion
I found a previous question here about this issue, it is a bug in R
The issue I am having is that I am working with a massive dataset, and I cannot notice whether new NA values are being added to the dataframe. (why would any NA values be added anyway?)
I tried to get around the problem by converting the data tables into dataframes before binding them.
table1 <- data.frame(table1)
table2 <- data.frame(table2)
bt=rbind(table1,table2)
I no longer get the error, but I am really worried about my data! were any NA values added? or is my data staying the same by doing this trick? I happy to continue with my data in the data.frame from.
Thanks,