Lendo o help da função table (?table)
table(..., exclude = if (useNA == "no") c(NA, NaN), useNA = c("no", "ifany", "always"), dnn = list.names(...), deparse.level = 1)
...
useNA
controls if the table includes counts of NA
values: the allowed values correspond to never, only if the count is positive and even for zero counts. This is overridden by specifying exclude = NULL
. Note that levels specified in exclude
are mapped to NA
and so included in NA
counts.
Ou seja:
x <- c(1:10, NA)
table(x)
table(x, useNA='ifany')
Ou tambem da para usar o
is.na:
sum(
is.na(x))
Sobre a diferença entre <NA> e NA é só como algumas classes mostram NA. Acho que é mais para diferenciar, ja que em textos pode ocorrer o texto NA, ja <NA> é um pouco mais dificil.