Connect MonetDB to R

Allows to pull data from MonetDB into R.



  • added isIdCurrent for improved compatibility with RSQLite
  • new option monetdb.log.query allows export of dbSendQuery statements to file
  • no longer depends on DBI but imports it. Preferred way of constructing connections: library(DBI); con <- dbConnect(MonetDB.R::MonetDB(), ...)


  • Added support for esoteric data types such as MONTH_INTERVAL (Thanks, Roman)
  • Cleaned up SQL to R type mapping (we had this twice)
  • Now creating actual R integers if data fits
  • dbWriteTable now quotes table/column names if necessary, and outputs warnings if it did
  • New mdbapply function to automatically create and run embedded R functions in MonetDB
  • Fixes for dplyr backend
  • Fix for case when query only returns a prompt (CALL ..., Thanks, Roman)
  • Fix for empty result set on dbGetQuery(), no longer returning NULL (Thanks, Fabian)
  • Fix for dbConnect(), it ignored the url parameter somehow, which broke some sqlsurvey
  • Added argument to in case users want to avoid quoting (a bit)
  • Fix for dbConnect() that should be more robust to invalid connections
  • Cleaned up quoting behavior in dbListTables(), dbRemoveTable() etc.
  • Now re-establishing connection if interrupt (CMD-C or ESC) occurs
  • Fixed a bug in for multiple CSV files without headers
  • Added transactions to so no empty tables are left over
  • Removed nrows parameter to
  • Added col.names argument to
  • dplyr src_monetdb now has a con parameter to pass an existing DBI connection
  • Fixed a bug when running in a non-UTF8 locale (Thanks, Marcis)
  • Fixed a bug when dbWriteTable would not adhere to transactional semantics
  • Fixed != comparisions in dplyr (Thanks, David)
  • Support for running MonetDB in embedded mode (MonetDBLite)
  • Support for monetdblite:/some/path URLs in dbConnect()
  • Fixed an off-by-one error in type conversion (Thanks, Kirill)
  • Wait support for monetdb.server.stop on Windows
  • dbWriteTable now invokes when called with a character vector as value argument


  • Fixed crash on Windows (Sorry, everyone)


  • new create= parameter (Thanks, Duncan)
  • deprecated nrows parameter to, not neccessary any more because of changes to MonetDB
  • Fixed non-ASCII character handling (Thanks, Roman)
  • Fully removed C-based socket code
  • support for dplyr verbs sample_n() and sample_frac()


  • Removed package date (Thanks, Dimitar)
  • Added sys. schema name to internal queries, so SET SCHEMA xx would not break things (Thanks again, Dimitar)
  • Fixed monetdb:// URL handling on newer R versions (Thanks, Alex)
  • DBI 0.3 compatibility (isValid etc.)
  • deprecated dbTransaction() (DBI has standardized dbBegin())
  • Back to R socket code for peace of mind
  • Code cleanup
  • dplyr integration moved to MonetDB.R package


  • dbWriteTable overhaul (thanks, Anthony)
  • Fix for dbListTables for MonetDB versions after Jan2014


  • Remove trailing slashes for monetdb.program.path parameter for monetdb.server.setup (Thanks, Anthony!)
  • fixed monetdbd.liststatus (Thanks, Bart)


  • monetdb_queryinfo method to find out things about an arbitrary query cheaply
  • new options monetdb.sequential, monetdb.debug.query and monetdb.debug.mapi
  • debug output now uses the message() function
  • source code cleanup
  • dbListTables() now hides system tables per default, also got options to include the schema name and quoting in the result (sys_tables, schema_names and quote)
  • fixed various TODO's in the code to get closer to 1.0 (exciting)
  • fixed a bug when the error identifier sent by MonetDB was non-numeric
  • IPv6 addresses in dbConnect() should now work (another long-standing TODO)


  • dbGetInfo() now supported on MonetDBConnection (dplyr compatibility)
  • dbTransaction(), dbCommit() and dbRollback() support
  • fixed leaking of socket variable in dbConnect()
  • fixed monetdb.server.setup for UNIX-like systems (Thanks, Enzo)
  • fixed issue in dbClearResult() which produced a protocol error


  • various extensions to
  • removed monet.frame from this package, moved to github


  • added parameters newline and quote to monetdb.write.csv


  • fixed bug when reading empty table (Thanks, Anthony)
  • removed assertion in mapisplit.c that triggered sometimes for unclear reasons


  • fixed a problem where integer SEXPs turned to double somehow


  • fixed bug in dbConnect() where port and timeout were not always integer values


  • fixed bug in dbWriteTable() where VARCHAR(255) was used for character data instead of STRING


  • New All-C socket code (Thanks, Windows)
  • new dbConnect() parameter organization (!)
  • new mc() shorthand method for db connections


  • More tip-toeing around in dbConnect()
  • More error-tolerant MAPI parsing


  • Changes in dbConnect() error handling


  • fix for [, large offsets are not translated to SQL correctly


  • fix for aggregatef(), formula arguments were not evaluated in the right direction
  • support for mathematical operations on boolean columns


  • fix for C implementation for line splitting


  • more fetch() fixes


  • string to line splitting to c, NA handling to C as well


  • c implementation of very expensive function


  • fetch() performance enhancements and bug fixes


  • minor fixes to fetch() function from basic DBI


  • some cran compatibility changes


  • tabulate() support
  • unique() support
  • bugfix in subset()


  • Quieter startup
  • dbSendQuery() now fails if the query is bogus
  • implemented dbGetException()


  • subset() is back!


  • merge() support from Anthony
  • CRAN cleanup
  • MonetDB control code for UNIX-like systems


  • bugfixes in monet.frame


  • rbind() support on monet.frame from Anthony


  • sample() support on monet.frame


  • bugfix in server control code from Anthony


  • integrated formula-based aggregation from Anthony


  • fixed a bug in aggregate() to allow count-aggregation on non-numeric columns


  • MonetDB server control code (Windows) from Anthony Damico


  • Increased default socket timeout to 24h. Rationale: Import jobs may take this long, and all operations can always be cancelled with CTRL-C


  • aggregate() support in DB


  • Column name, type and dimension hints for monet.frame, makes it faster


  • Initial support for sort(), head(), tail(), summary(), var(), sd(), quantile() and median() in monet.frame
  • Changed str() implementation to not show sample data but column names/types instead


  • first release aimed at CRAN publication
  • monet.frame virtual data object
  • various bugfixes
  • documentation
  • port in monetdb:// URI now optional, defaults to 50000


  • make dbColumnInfo return the R-side data type as well as the Monet-side one.


  • write support in dbSendQuery, new functions dbWriteTable and dbSendUpdate


  • fixed handling of boolean values, now have proper R types
  • new parameter to dbConnect to specify connection timeout
  • check for empty responses in .mapiRead, now stop()s with a warning and some help


  • initial version, basic read support

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


2.0.0 by Mitchell Weggemans, a year ago

Browse source code at

Authors: Mitchell Weggemans [aut, cre] , Hannes Muehleisen [aut] , Anthony Damico [aut] , Thomas Lumley [ctb]

Documentation:   PDF Manual  

Task views: High-Performance and Parallel Computing with R

MPL (== 2.0) license

Imports DBI, digest, testthat, methods, codetools

System requirements: MonetDB, available from

See at CRAN