count number of na's in a row r code example Example 1: how to count the number of NA in r sum(is.na(df$col)) Example 2: r count number of na sum(is.na(df))