Skip to content
Prev 173943 / 398503 Next

Mean of difftime vectors : "code infelicity" or intended behaviour ?

Dear list,

"+" (and "-") being defined for difftime class, I expected mean() to 
return something sensible. This is only half-true :
[1] 3
Time difference of 3 mins

Fine so far. However :
[1] 3
Time difference of NA mins

Ouch !

Curiously, var(), max() and min() behave as expected. What's so special 
with mean() ?
[ ... doesn't return anything relevant ]

NB : this isn't done for the hell of it. I intended to replace some 
missing dates, with something computed from other dates and mean time 
intervals).

Any thoughs ?

					Emmanuel Charpentier