From bgunter at gene.com  Tue Nov  9 22:09:10 2004
From: bgunter at gene.com (bgunter@gene.com)
Date: Tue Nov  9 22:09:18 2004
Subject: [Rd] colnames argument in sqlFetch backwards? (PR#7355)
Message-ID: <20041109210910.BE302EDE9@slim.kubism.ku.dk>

Full_Name: Bert Gunter
Version: 2.0.0 patched
OS: Win2000
Submission from: (NULL) (192.12.78.250)


The TRUE/FALSE options of the colnames argument in sqlFetch (RODBC) seem to be
reversed, at least for .xls files.

## z is a connection to an xls workbook opened by odbcConnectExcel()

> dat<-sqlFetch(z,'SuccessRates',colnames=FALSE)
> dat[1:5,]
  RecID     Name Run  Grams Lost Run (80L)
1    NA Activase 117 839.91              0
2    NA Activase 118 860.52              0
3    NA Activase 119 921.23              0
4    NA Activase  NA     NA              1
5    NA Activase 120 722.62              0

> dat2<-sqlFetch(z,'SuccessRates',colnames=TRUE)
> dat2[1:5,]
  NA Activase 117 839.91 0
2 NA Activase 118 860.52 0
3 NA Activase 119 921.23 0
4 NA Activase  NA     NA 1
5 NA Activase 120 722.62 0
6 NA Activase 121 762.48 0

I note also that the last column, "Lost Run (80L)," was actually TRUE/FALSE and
some blanks in the Excel sheet and was silently coerced to numeric. This is no
problem, of course, but I wonder if it's the intended behavior and, if so, is it
documented?


[Rd] colnames argument in sqlFetch backwards? (PR#7355)
bgunter@gene.com