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
Try this:
nonNA_counts <- sapply(df, function(x) sum(!is.na(x)))