我通过将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