Displaying 1 result from an estimated 1 matches for "countn".
Did you mean:
count
2009 Jul 07
6
how to count number of elements in a vector that are not NA ?
Hi,
is there a simpler way to count the number of elements in a vector
that are not NA than this:
countN <- function (v) {
return (Reduce(function (x, y) x + y, ifelse(is.na(v), 0, 1)))
}
?
- Godmar