1.5 NA

NA is a logical constant of length 1 that contains a missing value indicator. The NA coding can identify three situations.

  • ‘Not Available’. E.g. asking ‘what time is it?’ and there is no clock available.
  • ‘Not Applicable’. E.g. asking ‘are you pregnant, sir?’
  • ‘Not Announced’. E.g. being silent in an interrogation.
?NA
(x <- c(NA, 1:3, NA, 1000))
## [1]   NA    1    2    3   NA 1000
is.na(x)
## [1]  TRUE FALSE FALSE FALSE  TRUE FALSE
sum(is.na(x))
## [1] 2
anyNA(x)
## [1] TRUE