added special case for empty vectors in mean_excludeNaN