SWS-Methodology / faoswsProcessing

Repository containing function for standard data processing
0 stars 0 forks source link

Function to remove indigenous and biological meat checks for code length #7

Open sebastian-c opened 7 years ago

sebastian-c commented 7 years ago

The current implementation of removeIndigenousBiologicalMeat filters based on the length of the element code. This is worse than hardcoding as for someone not extremely familiar with all the codes, it's hard to work out why the restriction to 4 character exists.

This should be hardcoded as the various codes - a better solution than what's there now.

In addition, there's a warning and I don't see a reason for one to be thrown.

mkao006 commented 7 years ago

This is because indigenous meat and biological meat have 5 digit element code, where as everything else has 4 digits. This is a flaw in design of the classification, and I agree it is a poor implementation but this should be fixed by the classification rather than being handled by the algorithm.

The reason the warning is issued is because indigenous meat and biological meat should be imputed, however, due to it's design, the imputation algorithm can not impute it and thus it is temporary removed until it can be handled in a better way.