[R] RODBC package -- sqlQuery(channel,.....,nullstring=0) still gives NA's

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jan 12 10:14:22 CET 2005


On Tue, 11 Jan 2005, Luis Rideau Cruz wrote:

> R-help,
>
> I'm using the RODBC package to retrieve data froma ODBC database which
> contain NA's.
>
> By using the argument nullstring = "0"  in sqlQuery() I expect to
> coerce them to numeric but still get NA's in my select.

You need to read the help page (as the posting guide asks): it says

na.strings: character string(s) to be mapped to 'NA' when reading
           character data.

which is the opposite of what you are saying you want to do.

An ODBC database cannot contain NA's.  It may contain NULLs, and it may 
contain "NA", so we have no idea what you mean.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list