[R] "na.strings" and the like; suspending interpretation of "NA"

Jan Theodore Galkowski bayesianlogic at acm.org
Tue Aug 4 07:22:59 CEST 2009

Can someone point me to the proper place in the documentation or on the
Wiki where I can learn how to get R to stop interpreting the string "NA"
as something special?  I have a table in a database which contains
(among other things) country codes and continent codes.  The standard
set of two-letter codes includes "NA" to denote "North America". I
learned of the "na.strings" parameter for RODBC's "sqlQuery", being able
to shut down this interpretation when data is read in.

However, in the program which uses this data, I (must) have some other
instance where the "NA" gets spontaneously"interpreted as "not
available", shows up in vectors and lists as "<NA>", and breaks
function. I temporarily solved the problem by defining all instances of
"NA" in the database as "NAC".  It still would be good to know a
generaly solution.  I've seen something mentioned in conjunction with
"options", but I'm not sure what that is about.

Thanks much,

  - Jan, 
     Akamai Technologies,
     Cambridge, MA

More information about the R-help mailing list