Unused arguments error on .local() when loading from file.

424 views
Skip to first unread message

Fabio Eitelvein

unread,
Oct 30, 2014, 5:10:11 PM10/30/14
to sq...@googlegroups.com
Hi there,

I am trying to open a big file (~3GB) using sqlfd. I've just installed sqldf 0.4.9 on R version 3.1.1 for Mac OS X 10.9.2.

While trying to open the file like this:

f <- file("preprocessed.csv")
df <-sqldf("select * from f")

I get the following error:

Error in .local(conn, name, value, ...) :
unused arguments (comment.char = "", quote = "\"")

The same happens when I use read.csv.sql().

What am I doing wrong?

Thank you.

Best regards

Gabor Grothendieck

unread,
Oct 30, 2014, 6:31:52 PM10/30/14
to sq...@googlegroups.com


On Thursday, October 30, 2014 5:10:11 PM UTC-4, Fabio Eitelvein wrote:
Hi there,

I am trying to open a big file (~3GB) using sqlfd. I've just installed sqldf 0.4.9 on R version 3.1.1 for Mac OS X 10.9.2.

While trying to open the file like this:

f <- file("preprocessed.csv")
df <-sqldf("select * from f")

I get the following error:

Error in .local(conn, name, value, ...) :
  unused arguments (comment.char = "", quote = "\"")

The same happens when I use read.csv.sql().

Those arguments are not available.  sqldf and read.csv.sql uses sqlite to read in the data and sqlite is more limited than read.table in the range of arguments available.  

See ?sqldf


Gabor Grothendieck

unread,
Oct 31, 2014, 7:25:02 AM10/31/14
to sq...@googlegroups.com
In looking at this further there is an additional difference in RSQLite 1.0.0 (relative to the prior version) that was recently uploaded to CRAN that causes this.  

A fix is in googlecode repo at http://sqldf.googlecode.com .

Until this fixed version is on CRAN you can:

   1. build the new version from source, or

   2. source the fixed sqldf.R on the fly like this:

   library(sqldf)
   ... your code ...

Fabio Eitelvein

unread,
Nov 2, 2014, 12:57:30 PM11/2/14
to sq...@googlegroups.com
Hi Gabor,


On Friday, October 31, 2014 9:25:02 AM UTC-2, Gabor Grothendieck wrote:

In looking at this further there is an additional difference in RSQLite 1.0.0 (relative to the prior version) that was recently uploaded to CRAN that causes this.  

A fix is in googlecode repo at http://sqldf.googlecode.com .

Until this fixed version is on CRAN you can:

   1. build the new version from source, or

   2. source the fixed sqldf.R on the fly like this:

   library(sqldf)
   ... your code ...


This workaround did the trick for me.

Thank you very much! 

fran...@gmail.com

unread,
Dec 23, 2014, 8:23:15 AM12/23/14
to sq...@googlegroups.com

>    library(sqldf)
>    source("http://sqldf.googlecode.com/svn/trunk/R/sqldf.R")
>    ... your code ...

Great workaround, thanks.

Gabor Grothendieck

unread,
Dec 25, 2014, 9:50:41 AM12/25/14
to sq...@googlegroups.com, fran...@gmail.com
Note that a new version of sqldf was uploaded to CRAN in November so provided you have up to date R and packages then this should no longer be needed.  See Latest News on sqldf home page for more info.  http://sqldf.googlecode.com

 

jklk...@gmail.com

unread,
Jun 9, 2016, 8:28:10 AM6/9/16
to sqldf
Gabor Grothendieck於 2014年10月31日星期五 UTC+8下午7時25分02秒寫道:
I have same problem but it doesn't work for me.
What should I do?

Gabor Grothendieck

unread,
Jun 9, 2016, 8:34:24 AM6/9/16
to sqldf, jklk...@gmail.com
You will need to post a reproducible example.  It works for me.

> cat("a,b\n1,2\n", file = "processing.csv")
> library(sqldf)
> f <- file("processing.csv")
> sqldf("select * from f")
  a b
1 1 2
> read.csv.sql("processing.csv")
  a b
1 1 2
> R.version.string
[1] "R version 3.3.0 Patched (2016-05-03 r70575)"
> packageVersion("sqldf")
[1] ‘0.4.10’
> win.version()
[1] "Windows 8.1 x64 (build 9600)"
Reply all
Reply to author
Forward
0 new messages