4 ms·
It could be that I'm misunderstanding the problem, but I don't think that, in general, makes a lot of sense to define functions acting on NA values. What you re
by olvar_ 10y ago
It could be that I'm misunderstanding the problem, but I don't think that, in general, makes a lot of sense to define functions acting on NA values. What you really want are functions acting on arrays that may be missing some values, but not necessarily functions that can act on those missing values. This is because the NA values are an effect of the data tabulation, not some deeper mathematical necessity. In that sense, wouldn't it be much easier to endow every array with another list with the places where values are not available and define procedures that use other underlying functions to compute the results while filtering out the NAs? For instance, you could have two "mean" functions, one that filters NAs and then returns the mean of the rest, and another that returns the mean of the whole array and if there is an NA it just returns NA. Both functions could use the mean(x::Number) function but just wrap it in a different way. Or is this missing the point completely?