I have a big dataset that contains a lot of NAs and some non-Na values. At the moment I count my non-NA values for each column like this:
NA
With dplyr, that would be:
dplyr
library(dplyr) df %>% summarise_all(funs(sum(!is.na(.)))
The advantage of that approach is that you can use group_by before, and that you don't need to care about column names (it just summarizes all of them).
group_by