[datatable-help] Cannot convert from data.frame to data.table inside RStudio

jpbowman01 john at therandomco.com
Thu Jul 24 21:54:16 CEST 2014


Just to keep the solution to this problem available...

It turns out that if you have an integer in a data table = 2^31-1 and you
setkey on that variable, fail happens that sticks around after the failure
and has some bizarre effects that don't look like they have anything to do
with your index attempt or even the data table which you were trying to
index, e.g., the error messages in the OP.   Earlier in the day I had done
such a setkey; even with the data table deleted and working on toy problems,
as in the OP, these errors will occur.

I can clean out all the variables etc., but the failure persists in the
code, as some code appears to be overwritten when the attempt to index
occurs.  In RStudio the solution (other than the obvious "delete the
observation with the value that causes the problem") is to restart R.  

More generally, the solution would be for the setkey function to check for
values of 2^31-1 (or larger one assumes) on integer keys and fail
gracefully.



--
View this message in context: http://r.789695.n4.nabble.com/Cannot-convert-from-data-frame-to-data-table-inside-RStudio-tp4694494p4694497.html
Sent from the datatable-help mailing list archive at Nabble.com.


More information about the datatable-help mailing list