MonetDB.R is a R extension to connect the Open-Source database MonetDB with R. Using this extension, data that is stored can be used in R analyses with better performance. MonetDB.R is also an Open-Source project, and we welcome your contributions. The connector consists of two parts: A general-purpose DBI driver for MonetDB and a virtual data object. MonetDB.R is written in plain R and has no non-R dependencies (except of course MonetDB).
You will need to download and install MonetDB and the MonetDB.R connector package. Install a stable version of MonetDB.R from CRAN by typing in an R session:
If you like to live dangerous, you can also install the development version in a second step:
Your data will have to be imported into MonetDB first.
library(MonetDB.R) conn <- dbConnect(dbDriver("MonetDB"), "monetdb://localhost/demo") # write some test data data(iris) dbWriteTable(conn, "iris", iris) # read data by SQL query ds1 <- dbGetQuery(conn,"SELECT avg(sepal_width) FROM iris") # read data by virtual data object mdf <- monet.frame(conn,"iris") ds2 <- mean(mdf$sepal_width) # ds1 and ds2 are equivalent
After installation, you may access the built-in documentation by typing the following commands in an R session:
library(MonetDB.R) ?MonetDB.R ?monet.frame
If you have any questions, please do so on stackoverflow using both the
r tags. You may also view the archive of previously-asked questions. Please direct general MonetDB questions to the MonetDB mailing lists.