我正在尝试使用clusterfly,它取决于rggobi

我加载clusterfly并收到此错误:

> pacman::p_load(caret, clusterfly, devtools, geonames, inTrees, mclust, party,
+                RDSTK, reshape, ROCR, RRF, sqldf, stringi, tree, xlsx)
Error in inDL(x, as.logical(local), as.logical(now), ...) :
  unable to load shared object 'C:/Program Files/R/R-3.2.0/library/rggobi/libs/x64/rggobi.dll':
  LoadLibrary failure:  The specified path is invalid.

Failed with error:  ‘package ‘rggobi’ could not be loaded’
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/clusterfly_0.4.zip'
Content type 'application/zip' length 64469 bytes (62 KB)
downloaded 62 KB

package ‘clusterfly’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\hackr\AppData\Local\Temp\RtmpopFKT2\downloaded_packages

clusterfly installed
Error in inDL(x, as.logical(local), as.logical(now), ...) :
  unable to load shared object 'C:/Program Files/R/R-3.2.0/library/rggobi/libs/x64/rggobi.dll':
  LoadLibrary failure:  The specified path is invalid.

Failed with error:  ‘package ‘rggobi’ could not be loaded’
Warning message:
In pacman::p_load(caret, clusterfly, devtools, geonames, inTrees,  :
  Failed to install/load:
clusterfly

这似乎基本上表明rggobi.dll不在应有的位置。

因此,我尝试直接安装和加载rgobbi并得到相同的错误:
> install.packages("rggobi")
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/rggobi_2.1.20.zip'
Content type 'application/zip' length 422326 bytes (412 KB)
downloaded 412 KB

package ‘rggobi’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\hackr\AppData\Local\Temp\RtmpopFKT2\downloaded_packages
> require(rggobi)
Loading required package: rggobi
Error in inDL(x, as.logical(local), as.logical(now), ...) :
  unable to load shared object 'C:/Program Files/R/R-3.2.0/library/rggobi/libs/x64/rggobi.dll':
  LoadLibrary failure:  The specified path is invalid.

我发现这很奇怪,因此我在Windows资源管理器中进行了查看,文件rggobi.dll正好位于应有的位置:

在另一次尝试加载失败之后,我的下一个想法是可能存在某种文件许可权问题。因此,从rggobi文件夹开始,我chmod 777设置最大权限。

我仍然无法加载该程序包,我重复了chmod 777的过程,并尝试为每个连续的文件夹级别直接在require(gobbi)上输入rggobi.dll:
C:\Program Files\R\R-3.2.0\library>chmod 777 rggobi
C:\Program Files\R\R-3.2.0\library>cd rggobi
C:\Program Files\R\R-3.2.0\library\rggobi>ls
DESCRIPTION  LICENSE  Meta       NEWS  data  help  libs
INDEX        MD5      NAMESPACE  R     demo  html
C:\Program Files\R\R-3.2.0\library\rggobi>chmod 777 libs
C:\Program Files\R\R-3.2.0\library\rggobi>cd libs
C:\Program Files\R\R-3.2.0\library\rggobi\libs>chmod 777 x64
C:\Program Files\R\R-3.2.0\library\rggobi\libs>chmod 777 i386
C:\Program Files\R\R-3.2.0\library\rggobi\libs>cd x64
C:\Program Files\R\R-3.2.0\library\rggobi\libs\x64>ls
rggobi.dll  symbols.rds
C:\Program Files\R\R-3.2.0\library\rggobi\libs\x64>chmod 777 rggobi.dll

最后,在Github上打开问题后,Hadley Wickham推迟到lawremi,他建议尝试使用32位R,但这也导致了相同的结果。

如何使该dll/软件包可用于R?

最佳答案

我的解决方案是按照here中的指示进行操作

关于r - 尽管似乎可用,但无法加载rggobi.dll,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30245209/

10-12 20:01