Skip to content
Prev 349926 / 398521 Next

R (3.1.2) sub-setting code related to "NA" on Windows not working!

This is almost unreadable due to HTML posting (do read the posting guide!). However, it would seem that you somehow got your data converted to factors of which one level is NA. 

This may be surprising, but the difference is like that of
[1] NA 18
Levels: 18 NA
[1] <NA> 18  
Levels: 18

Notice that NA can be a real factor level, for instance abbreviating "North America" or "Noradrenaline".

It is fairly easy to generate this situation during data input, e.g.
+ NA
+ 18", na.strings="")$V1
[1] NA 18
Levels: 18 NA
 
-pd
On 13 Apr 2015, at 15:33 , Sarada Samantaray <sarada at greenhorizon.in> wrote: