SWS-Methodology / faoswsStandardization

Standardization logic for Food Balance Sheets
0 stars 6 forks source link

data.table type warnings #16

Closed sebastian-c closed 8 years ago

sebastian-c commented 8 years ago

There are a few cases that give warnings like the following:

Warning message:
In `[.data.table`(tree, measuredItemChildCPC == "24320", `:=`(standParentID,  :
  Coerced 'character' RHS to 'logical' to match the column's type. Either change the target column to 'character' first (by creating a new 'character' vector length 940 (nrows of entire table) and assign that; i.e. 'replace' column), or coerce RHS to 'logical' (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.

These are most likely cases where NA columns (NAlogical) are overwritten with a character. This doesn't work and succeeds with the above warning, while not making the appropriate change to the column.