1

I would like to mimic the solution once given to this question: R: how to rbind two huge data-frames without running out of memory, but using R::MonetDBLite rather than R::SQLite

I tried the following without success:

library(DBI)
library(MonetDB.R)
library(MonetDBLite)
library(sqldf)

m <- dbDriver("MonetDBLite")

invisible(
sqldf::sqldf("create table test_table as select * from data1 union select * from data2",
      dbname="test.monetdb",
      drv=m,
      verbose = TRUE)
)

Thanks for your help.

edit: the error I get

Error in drv == "" :
comparison (1) is possible only for atomic and list types
Error in !dbPreExists : invalid argument type
Timing stopped at: 0 0 0 

Session informations:

R version 3.3.0 (2016-05-03)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=French_France.1252  LC_CTYPE=French_France.1252
LC_MONETARY=French_France.1252 LC_NUMERIC=C
LC_TIME=French_France.1252
attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base
other attached packages:
[1] sqldf_0.4-10      RSQLite_1.0.0     gsubfn_0.6-6      proto_0.3-10
MonetDBLite_0.2.2 DBI_0.4-1         MonetDB.R_1.0.1
loaded via a namespace (and not attached):
[1] tools_3.3.0      codetools_0.2-14 digest_0.6.9     chron_2.3-47
tcltk_3.3.0 
Community
  • 1
  • 1
Cazz
  • 83
  • 7
  • It'll be helpful if you can tell us why it isn't succeeding (any errors, expected output vs actual output, etc.). – ytk Jun 06 '16 at 14:36
  • Welcome to Stack Overflow. Please have a look at [this link](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – Sotos Jun 06 '16 at 14:49
  • @ytk : I edited my question with the error message I got after running the code. – Cazz Jun 06 '16 at 14:57
  • @Sotos : shall I copy the minimal reproducible example from the original question I mentionned ? – Cazz Jun 06 '16 at 14:59
  • sqldf works with SQLite, H2, MySQL and PostgreSQL backends. You are trying to use it with a database that is not in that list and even if it were the `drv` argument is not a connection. Please take the time to read the sqldf package documentation before posting. – G. Grothendieck Jun 07 '16 at 00:29
  • @G. Grothendieck : thanks for the answer. I have read about the backend issue (I am certainly limited in the understanding though) but I was confused by the mention of "MonetDBLite::RMonetDBLite driver" to work with sqldf on this site: https://github.com/hannesmuehleisen/MonetDBLite/issues/24 – Cazz Jun 07 '16 at 12:22
  • That refers to a fork of sqldf and not the one on CRAN. – G. Grothendieck Jun 07 '16 at 13:17

0 Answers0