[R-sig-DB] dbWriteTable() is renaming the 'end' column

Hervé Pagès hp@ge@ @end|ng |rom |hcrc@org
Wed Sep 30 00:07:11 CEST 2009


Hi,

Consider the following data:

   mydata <- data.frame(start=1:5, end=11:15)

Then storing and retrieving the data shows that the 'end'
column was renamed:

   drv <- dbDriver("SQLite")
   con <- dbConnect(drv, dbname=":memory:")

   > dbWriteTable(con, "mydata", mydata)
   [1] TRUE
   > dbReadTable(con, "mydata")
     start end__1
   1     1     11
   2     2     12
   3     3     13
   4     4     14
   5     5     15

The culprit doesn't seem to be dbReadTable():

   > dbGetQuery(con, "SELECT * FROM mydata")
     row_names start end__1
   1         1     1     11
   2         2     2     12
   3         3     3     13
   4         4     4     14
   5         5     5     15

and using the sqlite3 client from outside R confirms this.

Looks like a bug in dbWriteTable().

Cheers,
H.

-- 
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M2-B876
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages using fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319




More information about the R-sig-DB mailing list