Skip to content
Prev 79768 / 398502 Next

RSQLite problems

Hi, I'm experimenting with using (R)SQLite to do data management.  Here are
two little problems that I've encountered:

1. The presence of ',' in string values causes trouble since ',' is also the
   delimiter used in the SQL statement. 

2. A newline '\n' line attached to the last string value of each row. 

Some examples:
Loading required package: DBI
[1] TRUE
yield   variety year            site
1 27.00000 Manchuria 1931 University Farm
2 48.86667 Manchuria 1931          Waseca
3 27.43334 Manchuria 1931          Morris
yield   variety year__1              site
1 27.00000 Manchuria    1931 University Farm\n
2 48.86667 Manchuria    1931          Waseca\n
3 27.43334 Manchuria    1931          Morris\n
Error in sqliteWriteTable(conn, name, value, ...) : 
	RS-DBI driver: (RS_sqlite_import: /tmp/RtmpgSNaLn/rsdbi6a5d128c line 1
expected 5 columns of data but found 6)

I'm using RSQLite 0.4.0 with R 2.1.1 on Mac OS X.

Cheers,

Michael