0

I have data (Gr) with 5312 observations. One of the variables (Cr) has 160 missing values (counted from the Excel file). However, none of the following commands seem to help me get the same number of missing values in R.

is.na(Gr$CR)  # All False
sum(is.na(Gr$Cr))  # 0
nomissing <- na.omit(Gr$Cr)  # N 5312; missing 0
length(subset(Gr, Cr == ""))  #  6

Could somebody help with this? The variable is of type "factor".

Shruthi
  • 1
  • 1
  • 1
    A [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) sure would help. – alexwhitworth Oct 14 '15 at 22:46
  • 1
    What does "missing" look like in an Excel file? What ever it might be, it doesn't appear to have been a naked `NA`. If it were a quoted "NA", it may have been left as a character value (and likely in the form of a factor column). Try: `sum( Gr$CR == "NA")` – IRTFM Oct 14 '15 at 23:29

0 Answers0