我通過將R安裝目錄移出磁盤C解決了這個問題。感謝Joris提供了很好的建議!我認爲R核心團隊也應該把它當成一個bug,並且對Windows xp的保護機制做些什麼。保存一個R項目時的壓縮問題
親愛的社區:
在使用R中的BIOMOD包,我總是得到以下問題:
錯誤xzfile(文件, 「WB」,壓縮= 9):無法打開連接 此外:警告消息: 在xzfile(文件,「WB」,壓縮= 9): 不能初始化LZMA編碼器,錯誤5
它是由包的作者,並且還幫助文件中說的「保存」這個問題應該是由於缺乏寫入權限而引起的。但是,當我以管理帳戶登錄並對所有操作進行評估時,我不知道問題所在。有人可以幫我嗎?我真的需要現在運行包。在此先感謝〜
真誠, 馬爾科
下面是在「拯救」幫助文件中的說明:在 當前目錄
失敗最常見的原因是缺乏寫入許可。關於「save.image」和用於在端的會話的 這將通過示出的消息等
Error in gzfile(file, "wb") : unable to open connection
In addition: Warning message:
In gzfile(file, "wb") :
cannot open compressed file '.RDataTmp',
probable reason 'Permission denied'
The defaults were changed to use compressed saves for 'save' in
2.3.0 and for 'save.image' in 2.4.0. Any recent version of R can
read compressed save files, and a compressed file can be
uncompressed (by 'gzip -d') for use with very old versions of R.*
抱歉信息的ommision節省: 這裏是sessionInfo():
> sessionInfo()
R version 2.12.2 (2011-02-25)
Platform: i386-pc-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=Chinese_People's Republic of China.936
[2] LC_CTYPE=Chinese_People's Republic of China.936
[3] LC_MONETARY=Chinese_People's Republic of China.936
[4] LC_NUMERIC=C
[5] LC_TIME=Chinese_People's Republic of China.936
attached base packages:
[1] splines stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] BIOMOD_1.1-6.8 foreign_0.8-42 gam_1.04
[4] randomForest_4.6-2 mda_0.4-1 class_7.3-3
[7] gbm_1.6-3.1 lattice_0.19-17 MASS_7.3-11
[10] Design_2.3-0 Hmisc_3.8-3 survival_2.36-5
[13] rpart_3.1-48 nnet_7.3-1 ade4_1.4-16
[16] rgdal_0.6-33 dismo_0.5-19 rJava_0.9-0
[19] raster_1.7-47 sp_0.9-78
loaded via a namespace (and not attached):
[1] cluster_1.13.3 grid_2.12.2 tools_2.12.2
現在我發現問題來形成LZMA編碼器在做「保存」:
> x<-runif(100)
> save(x, file = "F:/test.gzip", compress='gzip')
> save(x, file = "F:/test.xz", compress='xz')
Error in xzfile(file, "wb", compression = 9) : cannot open the connection
>
您是在基於Windows或Unix的系統上? – 2011-03-01 02:00:49
什麼版本的R和哪個版本的BIOMOD,以及該包在哪裏?使用sessionInfo()獲得版本摘要 – mdsumner 2011-03-01 02:33:05
您究竟在哪裏保存了您的R版本,以及您擁有哪個版本的Windows?您可以嘗試以管理員身份運行R(與具有管理員權限的帳戶中運行R不同),或者不將R安裝在Program Files文件夾中。問題可能在那裏,因爲它是Windows下的受保護文件夾。從錯誤中,似乎無法讀取臨時文件。 – 2011-03-01 12:19:19