簡體   English   中英

R> Monetdb,dbConnect錯誤(軟件包Monetdb.R)

[英]R > Monetdb, dbConnect error (package Monetdb.R)

嘗試將R中的(dbConnect())從R連接到MonetDB(使用MonetDB.R)時出現錯誤。 有一個( 相關的SO問題 ),我也嘗試了以下建議((a)使用MonetDB.R beta版本0.9.5或(a)使用常規的MonetDB.R,但將DBI軟件包替換為較早的版本(0.2-7) )) 沒有成功。

這是代碼和錯誤:

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詳細信息:RStudio版本0.98.1062上的Windows 8.0

> 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

嘗試的解決方案和相應的錯誤:

a)嘗試安裝MonetDB.R_0.9.5.zip(測試版)

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)保留MonetDB.R常規版本(cran),但將DBI更改為較早版本(在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 )

#給出與上述相同的錯誤,斷言失敗! 程序:C:\\ Program Files \\ RStudio \\ bin \\ x64 \\ rsession.exe文件:mapi.c,第91行表達式:IS_INTEGER(port)#然后RStudio顯示錯誤:“ R會話異常終止”

MonetDB.R 0.9.5已發布到CRAN。 Windows二進制發行版應該很快就會可用。

該錯誤可能出在創建dbConnect的行中。

您的代碼(端口錯誤):

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

正確的代碼:

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

此代碼的另一個問題可能是將dbport選擇為50003。 我相信默認值為5萬。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM