I run R 2.0.1 on Debian and connect to Informix database via RODBC. In the table below the column "month" is of type char(1). RODBC seems to be converting this column to boolean if the value is F or T. This is the data in my table: id month year 25 F 2005 26 Z 2005 When I select * for id 25 I get 25 FALSE 2005 When I select * for id 16 I get 26 Z 2005 Is there a fix for this issue? I invoke odbc connect with: db <- odbcConnect("mydb", believeNRows=FALSE)
Prof Brian Ripley
2005-Feb-23 17:55 UTC
RODBC works as documented (was [R] RODBC type conversion bug)
On Wed, 23 Feb 2005, Omar Lakkis wrote:> I run R 2.0.1 on Debian and connect to Informix database via RODBC. In > the table below the column "month" is of type char(1). RODBC seems to > be converting this column to boolean if the value is F or T.Sounds reasonable. So would read.table, and that equally is not a bug but as documented.> This is the data in my table: > > id month year > 25 F 2005 > 26 Z 2005 > > When I select * for id 25 I get > 25 FALSE 2005 > > When I select * for id 16 I get > 26 Z 2005 > > Is there a fix for this issue?Yes, for you to read the help page (as the posting guide asks you to do before posting). See ?sqlGetResults and its description of 'as.is'. -- 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