Luis Rideau Cruz
2005-Jan-11 15:34 UTC
[R] RODBC package -- sqlQuery(channel,.....,nullstring=0) still gives NA's
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. I'm running on Windows XP> version_ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 0.1 year 2004 month 11 day 15 language R Thank you
Prof Brian Ripley
2005-Jan-12 09:14 UTC
[R] RODBC package -- sqlQuery(channel,.....,nullstring=0) still gives NA's
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, 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