【问题标题】:r rattle fancyrpartplot errorsr 拨浪鼓花式部分绘图错误
【发布时间】:2017-03-25 12:02:52
【问题描述】:

第一次尝试运行 fancyrpartplot 并遇到错误。

> fancyRpartPlot(rpart.sub1)
Error in loadNamespace(name) : there is no package called ‘rpart.plot’

我已经搜索和搜索,但找不到解决方案。我已经尝试删除拨浪鼓和 RGtk2 并不断收到相同的错误。认为它与 GTK+ 有关,但找不到任何显示如何删除和重新安装 GTK+ 的内容

> remove.packages("RGtk2")
Removing package from ‘C:/Program Files/R/R-3.1.0/library’
(as ‘lib’ is unspecified)
> remove.packages("rattle")
Removing package from ‘C:/Program Files/R/R-3.1.0/library’
(as ‘lib’ is unspecified)

Restarting R session...

> install.packages("rattle")
also installing the dependency ‘RGtk2’

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/RGtk2_2.20.31.zip'
Content type 'application/zip' length 13914471 bytes (13.3 Mb)
opened URL
downloaded 13.3 Mb

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/rattle_4.0.0.zip'
Content type 'application/zip' length 3728887 bytes (3.6 Mb)
opened URL
downloaded 3.6 Mb

package ‘RGtk2’ successfully unpacked and MD5 sums checked
package ‘rattle’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\xxx\AppData\Local\Temp\RtmpsLxgOv\downloaded_packages
> require(RGtk2)
Loading required package: RGtk2
Error in inDL(x, as.logical(local), as.logical(now), ...) : 
  unable to load shared object 'C:/Program Files/R/R-3.1.0/library/RGtk2/libs/x64/RGtk2.dll':
  LoadLibrary failure:  The specified module could not be found.

In addition: Warning message:
package ‘RGtk2’ was built under R version 3.1.3 
trying URL 'http://ftp.gnome.org/pub/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip'
Content type 'application/zip' length 25830230 bytes (24.6 Mb)
opened URL
downloaded 24.6 Mb

Learn more about GTK+ at http://www.gtk.org
If the package still does not load, please ensure that GTK+ is installed and that it is on your PATH environment variable
IN ANY CASE, RESTART R BEFORE TRYING TO LOAD THE PACKAGE AGAIN
Warning messages:
1: Failed to load RGtk2 dynamic library, attempting to install it. 
2: In dir.create(config_path, recursive = TRUE) :
  'C:\Program Files\R\R-3.1.0\library\RGtk2\gtk\x64\etc\gtk-2.0' already exists
> require(rattle)
Loading required package: rattle
Rattle: A free graphical interface for data mining with R.
Version 4.0.0 Copyright (c) 2006-2015 Togaware Pty Ltd.
Type 'rattle()' to shake, rattle, and roll your data.
Warning message:
package ‘rattle’ was built under R version 3.1.3 
> fancyRpartPlot(rpart.sub1)
Error in loadNamespace(name) : there is no package called ‘rpart.plot’

有趣的是,它说缺少C:/Program Files/R/R-3.1.0/library/RGtk2/libs/x64/RGtk2.dll 的文件实际上在那里,我已经手动检查了。

在这一点上,我已经多次删除了拨浪鼓和 RGtk2。每次 RGtk2 再次安装 GTK+ 但没有任何变化。

非常感谢任何帮助。

编辑:应该添加如果我输入rattle(),嘎嘎声似乎可以正确加载。

【问题讨论】:

  • 安装包 rpart 和 rpart.plot
  • @phiver plot(rpart.sub1) 正确绘制了 rpart 创建的树,所以我知道 rpart 和 rpart.plot 都已安装并正常工作。
  • @SC。 plot(rpart.sub1) 并不意味着 rpart.plot 可用。它只是绘制 rpart.sub1。用 rpart.plot 绘图意味着使用命令 prp (或 rpart.plot::prp(rpart.sub1)
  • @phiver 非常感谢。你 100% 正确我错过了 rpart.plot 包。一旦我安装了它,fancyrpartplot 就可以完美运行。想知道为什么它没有作为依赖安装。那好吧。再次感谢您。

标签: r rattle


【解决方案1】:

每个@phiver rpart.plot 丢失

【讨论】:

    【解决方案2】:

    根据警告“LoadNamespace(name) 中的错误:没有名为‘rpart.plot’的包”,输入:install.packages(“rpart.plot”)。

    【讨论】:

      猜你喜欢
      • 2016-07-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-11
      • 1970-01-01
      • 2019-01-31
      • 2014-08-31
      • 2014-06-19
      相关资源
      最近更新 更多