[datatable-help] Bug filled [#4878]

statquant3 statquant at outlook.com
Tue Sep 3 16:59:52 CEST 2013


Yes x = NA makes x logical but data.table is supposed to keep the type of the
LHS when you do an update That's why you get the usual 
Message d'avis :
In `[.data.table`(DT, , `:=`(a, 1.1)) :
  Coerced 'double' RHS to 'integer' to match the column's type; may have
truncated precision. Either change the target column to 'double' first (by
creating a new 'double' vector length 3 (nrows of entire table) and assign
that; i.e. 'replace' column), or coerce RHS to 'integer' (e.g. 1L,
NA_[real|integer]_, as.*, etc) to make your intent clear and for speed. Or,
set the column type correctly up front when you create the table and stick
to it, please.

So I think it should still be the case even for 1 row data.table



--
View this message in context: http://r.789695.n4.nabble.com/Bug-filled-4878-tp4675263p4675268.html
Sent from the datatable-help mailing list archive at Nabble.com.


More information about the datatable-help mailing list