I am trying to find a simple way of counting the non missing cases in a column of a data frame. I have used the function:
foo<- function(x) { sum(!is.na(x)) }
and then apply it to a data frame via sapply()
stats$count <- sapply(OldExaminee, foo2, simplify=T)
Although this is working fine, I am just in disbelieve that there isn't a simpler way of counting, i.e. something in the base set of function.
Any ideas?