sum(is.xy(x)) in CountInf and countNA (is faster according to Gerhard Nachtmann).