NA item is a special object in R and represents “Not Available;able”. Sometimes this is because data were genuinely not collected (and therefore really are missing). Other times it is because you have columns of unequal length and your
data.frame is padded out (with
NA) to make a rectangular object with all columns containing the same number of elements.
na.rm = TRUE parameter can be used to “take care” of
NA items in some summary commands, e.g.
 2 4 3 6 2 8 NA NA
mean(x, na.rm = TRUE)
However, this does not always work.
length(x, na.rm = TRUE)
Error in length(x, na.rm = TRUE) : 2 arguments passed to 'length' which requires 1
In this case the
na.omit() command can be used to strip out the
na.omit() command essentially removes all the