Hello,
I have an application producing lots of data, collating everything into a
matrix. Sometimes one entry is missing: I would like to fill it with
something preserving the ability for statistical functions to return
something meaningfull.
For instance:
A = randn(4, 4)
A(2, 3) = NA;
mean(A) => the third column result is 'NA'
Same game for 'NaN'; furthermore
A(2, 3) = [] is rejected.
What I would like is some option like R 'skipNA = true', meaning:
- compute sum, mean, std, ... over some dimension, by default on a
column-basis
- extract a slice, and do not take into account NA and NaN values. For
'sum', the end result is a numeric value; provided at least one value is not
special; for operations like 'mean' and 'std' the degrees of freedom have to
be recomputed each time at least one NA/NaN is present.
Any clue ? Could this option be implemented into the standard implementation
? I would like not to implement a new class where NaN are automatically
discarded ?
Regards
Pascal