Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Missing value best practices (NA vs NaN vs -999)


ariklee Apr 3, 2018 11:10 PM

I am deploying multiple loggers, each with sizable data table (more than 100 values). Each logger will have almost the same sensors, but on a couple loggers there will be no pressure transducer. In order to make data analyses easier (and efficient), I am writing a script to read the data table(s) and generate plots. Therefore, all data tables in my loggers are the same. The loggers without pressure transducer will still have that field in the data table, but it will be filled with placeholder value. In the past I've used -999 as the placeholder for "no sensor", but if someone else gets the data they might misunderstand. I don't want to use 0, because the client may see this and think a pressure transducer exists there and pressure is 0. I don't want to store NAN because that looks like a calculation (or sensor) might be returning garbage or value out of range.

In CRBasic, is there the equivalent of "NA" value to indicate that the variable or value does not exist? What are some best practices to implement a value that doesn't exist?


JDavis Apr 4, 2018 03:14 PM

Your data table would have the field set to a numeric data type. NAN is a defined value in floating point format, so it works in the same data column. NA does not have a defined value. You would have to switch that column to a string data type, so I would avoid NA.

It is probably best to look at what an agency is doing, whom you might share data with. For example, if you pull data from the National Climate Data Center they have defined what bad data is marked with.

Log in or register to post/reply in the forum.