简体   繁体   中英

R > Monetdb, dbConnect error (package Monetdb.R)

I'm getting an error when trying to connect (dbConnect()) from within R to MonetDB (using MonetDB.R). There is a ( related SO question ) and I also tryed the sugestions there ( (a) use MonetDB.R beta version 0.9.5 or (a) use the regular MonetDB.R but replace DBI package with an earlier version (0.2-7)) without success.

This is the code and errors:

library(MonetDB.R)
options( "monetdb.sequential" = TRUE )
setwd("C:/Users/lucas_000/Desktop/Curso R/importa_RAIS")
batfile <-
  monetdb.server.setup(
    database.directory = paste( getwd() , "/MonetDB", sep="") ,
    monetdb.program.path = 
      ifelse(.Platform$OS.type == "windows" , "C:/Program Files/MonetDB/MonetDB5" , "" ) ,
    dbname = "RAIS" , dbport = 50003
  )

batfile <- "C:/Users/lucas_000/Desktop/Curso R/importa_RAIS/MonetDB/RAIS.bat"
dbname <- "RAIS"
dbport <- 50003  
pid <- as.numeric(monetdb.server.start( batfile ))
# output indicates:  MonetDB 5 server v11.17.21 "Jan2014-SP3"

db <- dbConnect( MonetDB.R() , "monetdb://localhost:5003/RAIS" , wait = TRUE )

Assertion Failed!
Program: C\:Program Files\RStudio\bin\x64\rsession.exe
File: mapi.c, Line 91
Expression: IS_INTEGER(port)
#Then RStudio displays an error: "R Session Aborted"

Sistem details: Windows 8.0, on RStudio, Version 0.98.1062

> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)

other attached packages:
 [1] R.utils_1.33.0     R.oo_1.18.0        R.methodsS3_1.6.1  downloader_0.3    
 [5] RCurl_1.95-4.3     bitops_1.0-6       sqlsurvey_0.6-11   survey_3.30-3     
 [9] KernSmooth_2.23-12 MonetDB.R_0.9.4    digest_0.6.4       DBI_0.3.1         

loaded via a namespace (and not attached):
[1] tools_3.1.1

Attempted solutions and respective errors:

a) TRYING TO INSTALL MonetDB.R_0.9.5.zip (beta version)

library(devtools)
remove.packages("MonetDB.R")
install_url("http://homepages.cwi.nl/~hannes/R/MonetDB.R_0.9.5.zip")

* installing *binary* package 'MonetDB.R' ...
cp: unknown option -- )
Try `/usr/bin/cp --help' for more information.
Aviso: execução do comando 'cp -R . "C:/Users/lucas_000/Documents/R/win-        library/3.1/MonetDB.R" || ( tar cd - .| (cd "C:/Users/lucas_000/Documents/R/win-library/3.1/MonetDB.R" && tar -xf -))' teve status 1
ERROR: installing binary package failed
* removing 'C:/Users/lucas_000/Documents/R/win-library/3.1/MonetDB.R'
Error: Command failed (1)       

b) Keeping the MonetDB.R regular version (cran) but changing the DBI to an earlier version (also sugested on SO):

remove.packages("DBI")
library(devtools)
install_url("cran.r-project.org/src/contrib/Archive/DBI/DBI_0.2-7.tar.gz")
library(DBI)
db <- dbConnect( MonetDB.R() , "monetdb://localhost:5003/RAIS" , wait = TRUE )

# gives same error as above, Assertion Failed! Program: C:Program Files\\RStudio\\bin\\x64\\rsession.exe File: mapi.c, Line 91 Expression: IS_INTEGER(port) #Then RStudio displays an error: "R Session Aborted"

MonetDB.R 0.9.5 has been released to CRAN. Windows binary distributions should be available shortly.

The error may have been in the line where you create the dbConnect.

Your code (incorrect port):

db <- dbConnect( MonetDB.R() , "monetdb://localhost:5003/RAIS" , wait = TRUE )

Correct code:

db <- dbConnect( MonetDB.R() , "monetdb://localhost:50003/RAIS" , wait = TRUE )

Another issue with this code may have been choosing dbport to be be 50 003; I believe the default is 50 000.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM